diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-12 03:27:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-12 03:27:19 +0000 |
commit | 097a8b8777b0c31b91acaaa40f91a1bd917e09c8 (patch) | |
tree | 86974cd7695a729892a4c8930c281ed68afb726b /clang/lib/Lex/Lexer.cpp | |
parent | 8637abd333d79a8d4a8b1d3c32f764bf46b91848 (diff) | |
download | bcm5719-llvm-097a8b8777b0c31b91acaaa40f91a1bd917e09c8.tar.gz bcm5719-llvm-097a8b8777b0c31b91acaaa40f91a1bd917e09c8.zip |
Fix a couple more places that poke KeepCommentMode unnecesarily.
llvm-svn: 57398
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 23afa323f8d..d2aef765260 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -100,7 +100,8 @@ Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp, LexingRawMode = false; // Default to keeping comments if requested. - KeepCommentMode = PP->getCommentRetentionState(); + KeepCommentMode = false; + SetCommentRetentionState(PP->getCommentRetentionState()); } /// Lexer constructor - Create a new raw lexer object. This object is only @@ -1117,7 +1118,7 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { FormTokenWithChars(Result, CurPtr); // Restore comment saving mode, in case it was disabled for directive. - KeepCommentMode = PP->getCommentRetentionState(); + SetCommentRetentionState(PP->getCommentRetentionState()); return true; // Have a token. } @@ -1236,7 +1237,7 @@ LexNextToken: ParsingPreprocessorDirective = false; // Restore comment saving mode, in case it was disabled for directive. - KeepCommentMode = PP->getCommentRetentionState(); + SetCommentRetentionState(PP->getCommentRetentionState()); // Since we consumed a newline, we are back at the start of a line. IsAtStartOfLine = true; |