aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-03 00:04:13 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-03 00:04:13 +0000
commit88710f22be1acb04b7d812aebe87bea56394c07c (patch)
tree647f722b97d3c9f51785c7d7d33d1ce4392d928c /include/clang/Lex/Preprocessor.h
parente164c180527354acc16c1b9b2c5a5ed4a1e484d4 (diff)
A couple fixes for preprocessor expressions:
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases. 2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also r97253, which addressed the case of "#if defined(FOO FOO".) Fixes PR10286. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 2a2f099548..a95645451e 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -556,6 +556,14 @@ public:
DisableMacroExpansion = OldVal;
}
+ /// LexUnexpandedNonComment - Like LexNonComment, but this disables macro
+ /// expansion of identifier tokens.
+ void LexUnexpandedNonComment(Token &Result) {
+ do
+ LexUnexpandedToken(Result);
+ while (Result.getKind() == tok::comment);
+ }
+
/// LookAhead - This peeks ahead N tokens and returns that token without
/// consuming any tokens. LookAhead(0) returns the next token that would be
/// returned by Lex(), LookAhead(1) returns the token after it, etc. This