[clang] [clang] Clarify SourceLocation and (Char)SourceRange docs (PR #177400)

Tobias Ribizel via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 29 09:17:56 PST 2026


================
@@ -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.
----------------
upsj wrote:

Here I was going by the output of getSourceRange() of a random AST node, I can check again.

https://github.com/llvm/llvm-project/pull/177400


More information about the cfe-commits mailing list