[cfe-commits] r57399 - /cfe/trunk/lib/Lex/PPDirectives.cpp
Chris Lattner
sabre at nondot.org
Sat Oct 11 20:31:34 PDT 2008
Author: lattner
Date: Sat Oct 11 22:31:33 2008
New Revision: 57399
URL: http://llvm.org/viewvc/llvm-project?rev=57399&view=rev
Log:
Stop the preprocessor from poking the lexer's private parts.
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=57399&r1=57398&r2=57399&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Sat Oct 11 22:31:33 2008
@@ -150,7 +150,7 @@
// directive mode. Tell the lexer this so any newlines we see will be
// converted into an EOM token (this terminates the macro).
CurLexer->ParsingPreprocessorDirective = true;
- CurLexer->KeepCommentMode = false;
+ CurLexer->SetCommentRetentionState(false);
// Read the next token, the directive flavor.
@@ -161,7 +161,7 @@
if (Tok.isNot(tok::identifier)) {
CurLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->KeepCommentMode = KeepComments;
+ CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
@@ -176,7 +176,7 @@
FirstChar != 'i' && FirstChar != 'e') {
CurLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->KeepCommentMode = KeepComments;
+ CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
@@ -197,7 +197,7 @@
if (IdLen >= 20) {
CurLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->KeepCommentMode = KeepComments;
+ CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
memcpy(Directive, &DirectiveStr[0], IdLen);
@@ -278,7 +278,7 @@
CurLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->KeepCommentMode = KeepComments;
+ CurLexer->SetCommentRetentionState(KeepComments);
}
// Finally, if we are out of the conditional (saw an #endif or ran off the end
@@ -828,7 +828,7 @@
// If we are supposed to keep comments in #defines, reenable comment saving
// mode.
- CurLexer->KeepCommentMode = KeepMacroComments;
+ CurLexer->SetCommentRetentionState(KeepMacroComments);
// Create the new macro.
MacroInfo *MI = new MacroInfo(MacroNameTok.getLocation());
More information about the cfe-commits
mailing list