From b352e3edb559020e904d52941b039c5cebb26056 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Nov 2006 06:17:10 +0000 Subject: Change KeepComments/KeepMacroComments modes to be facets of the preprocessor state, not aspects of the language standard being parsed. llvm-svn: 39209 --- clang/Lex/Lexer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/Lex/Lexer.cpp') diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index 3ae7b6a4e51..4a57ac2c74b 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -67,7 +67,7 @@ Lexer::Lexer(const SourceBuffer *File, unsigned fileid, Preprocessor &pp, LexingRawMode = false; // Default to keeping comments if requested. - KeepCommentMode = Features.KeepComments; + KeepCommentMode = PP.getCommentRetentionState(); } /// Stringify - Convert the specified string into a C string, with surrounding @@ -970,7 +970,7 @@ bool Lexer::LexEndOfFile(LexerToken &Result, const char *CurPtr) { FormTokenWithChars(Result, CurPtr); // Restore comment saving mode, in case it was disabled for directive. - KeepCommentMode = Features.KeepComments; + KeepCommentMode = PP.getCommentRetentionState(); return true; // Have a token. } @@ -1087,7 +1087,7 @@ LexNextToken: ParsingPreprocessorDirective = false; // Restore comment saving mode, in case it was disabled for directive. - KeepCommentMode = Features.KeepComments; + KeepCommentMode = PP.getCommentRetentionState(); // Since we consumed a newline, we are back at the start of a line. IsAtStartOfLine = true; -- cgit v1.2.3