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 | f744d133e8d36eec65828d046ee695bda238125c (patch) | |
tree | 25c18433b77065ad8a2490649a2a1a3e9a3c197c /lib/Lex/Lexer.cpp | |
parent | fa95a019da00b926d64ff83358ba73bbc6ae1e37 (diff) |
Fix a couple more places that poke KeepCommentMode unnecesarily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 23afa323f8..d2aef76526 100644 --- a/lib/Lex/Lexer.cpp +++ b/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; |