[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:28 PST 2026
================
@@ -86,6 +86,10 @@ using FileIDAndOffset = std::pair<FileID, unsigned>;
/// In addition, one bit of SourceLocation is used for quick access to the
/// information whether the location is in a file or a macro expansion.
///
+/// SourceLocation operates on a character level, i.e. offsets describe
+/// character distances, but in most cases, they are used on a token level,
----------------
upsj wrote:
Right, I was just thinking of ASCII. I would assume this is bytes, since we use `substr` to retrieve the actual byte contents IIRC.
https://github.com/llvm/llvm-project/pull/177400
More information about the cfe-commits
mailing list