================
@@ -212,6 +216,11 @@ inline bool operator>=(const SourceLocation &LHS, const
SourceLocation &RHS) {
}
/// A trivial tuple used to represent a source range.
+///
+/// SourceRange is an inclusive range [begin, end] that contains its endpoints,
+/// and when referring to tokens, its begin SourceLocation usually points to
+/// the first character of the first token and its end SourceLocation points to
+/// the last character of the last token.
----------------
AaronBallman wrote:
Does it point to the last character of the last token? I thought when it refers
to tokens, the end of the range is the first character of the last token (so
token source locations are always pointing at the start of the token).
Otherwise our documentation is kind of in conflict because the above bit on
`SourceLocation` says:
> but in most cases, they are used on a token level,
> where a SourceLocation points to the first character of a lexer token.
which would make the begin and end source locations behave quite differently in
a `SourceRange`.
https://github.com/llvm/llvm-project/pull/177400
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits