add a new inKeepCommentMode() accessor to abstract the KeepCommentMode
ivar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57397 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index a259b2a..23afa32 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -804,7 +804,7 @@
// Found but did not consume the newline.
// If we are returning comments as tokens, return this comment as a token.
- if (KeepCommentMode)
+ if (inKeepCommentMode())
return SaveBCPLComment(Result, CurPtr);
// If we are inside a preprocessor directive and we see the end of line,
@@ -1015,7 +1015,7 @@
}
// If we are returning comments as tokens, return this comment as a token.
- if (KeepCommentMode) {
+ if (inKeepCommentMode()) {
Result.setKind(tok::comment);
FormTokenWithChars(Result, CurPtr);
return false;
@@ -1263,10 +1263,10 @@
// If the next token is obviously a // or /* */ comment, skip it efficiently
// too (without going through the big switch stmt).
- if (CurPtr[0] == '/' && CurPtr[1] == '/' && !KeepCommentMode) {
+ if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode()) {
SkipBCPLComment(Result, CurPtr+2);
goto SkipIgnoredUnits;
- } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !KeepCommentMode) {
+ } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !inKeepCommentMode()) {
SkipBlockComment(Result, CurPtr+2);
goto SkipIgnoredUnits;
} else if (isHorizontalWhitespace(*CurPtr)) {