Fix a couple more places that poke KeepCommentMode unnecesarily.
llvm-svn: 57398
This commit is contained in:
parent
8637abd333
commit
097a8b8777
|
@ -100,7 +100,8 @@ Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp,
|
||||||
LexingRawMode = false;
|
LexingRawMode = false;
|
||||||
|
|
||||||
// Default to keeping comments if requested.
|
// 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
|
/// 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);
|
FormTokenWithChars(Result, CurPtr);
|
||||||
|
|
||||||
// Restore comment saving mode, in case it was disabled for directive.
|
// Restore comment saving mode, in case it was disabled for directive.
|
||||||
KeepCommentMode = PP->getCommentRetentionState();
|
SetCommentRetentionState(PP->getCommentRetentionState());
|
||||||
return true; // Have a token.
|
return true; // Have a token.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1236,7 +1237,7 @@ LexNextToken:
|
||||||
ParsingPreprocessorDirective = false;
|
ParsingPreprocessorDirective = false;
|
||||||
|
|
||||||
// Restore comment saving mode, in case it was disabled for directive.
|
// 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.
|
// Since we consumed a newline, we are back at the start of a line.
|
||||||
IsAtStartOfLine = true;
|
IsAtStartOfLine = true;
|
||||||
|
|
Loading…
Reference in New Issue