diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-06-06 18:52:13 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-06-06 18:52:13 +0000 |
commit | d5321247c4e2315d7aae3dd4c74da5babe3101a0 (patch) | |
tree | 9f504d415dbad0f7c7b417a9b54d1e57a8e3ce78 /clang/lib/Lex/Lexer.cpp | |
parent | ef42a6fb1dfd3f8386d65e784cec60e2dfce7319 (diff) | |
download | bcm5719-llvm-d5321247c4e2315d7aae3dd4c74da5babe3101a0.tar.gz bcm5719-llvm-d5321247c4e2315d7aae3dd4c74da5babe3101a0.zip |
Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.
Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).
llvm-svn: 158093
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index a43543ad9a4..4ab0dae1fa1 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -2022,7 +2022,7 @@ bool Lexer::SaveBCPLComment(Token &Result, const char *CurPtr) { // directly. FormTokenWithChars(Result, CurPtr, tok::comment); - if (!ParsingPreprocessorDirective) + if (!ParsingPreprocessorDirective || LexingRawMode) return true; // If this BCPL-style comment is in a macro definition, transmogrify it into @@ -2626,7 +2626,8 @@ LexNextToken: ParsingPreprocessorDirective = false; // Restore comment saving mode, in case it was disabled for directive. - SetCommentRetentionState(PP->getCommentRetentionState()); + if (!LexingRawMode) + SetCommentRetentionState(PP->getCommentRetentionState()); // Since we consumed a newline, we are back at the start of a line. IsAtStartOfLine = true; |