Skip to content

Commit f357e5e

Browse files
committed
Update the comment to explciitly mention that the column number of the end position is exclusive.
1 parent 7243489 commit f357e5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Frontend/FrontendAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class DeserializedDeclsSourceRangePrinter : public ASTConsumer,
118118
const CharSourceRange &Range,
119119
const LangOptions &LangOpts) {
120120
// For token ranges, compute end location for end character of the range.
121-
// The end location of returned range is exclusive.
122121
CharSourceRange R = Lexer::getAsCharRange(Range, SM, LangOpts);
123122
SourceLocation End = R.getEnd();
124123
// Relex the token past the end location of the last token in the source
@@ -127,6 +126,7 @@ class DeserializedDeclsSourceRangePrinter : public ASTConsumer,
127126
Lexer::getRawToken(End, PossiblySemi, SM, LangOpts, true);
128127
if (PossiblySemi.is(tok::semi))
129128
End = End.getLocWithOffset(1);
129+
// Column number of the returned end position is exclusive.
130130
return {SM.getSpellingLineNumber(End), SM.getSpellingColumnNumber(End)};
131131
}
132132
};

0 commit comments

Comments
 (0)