// directive mode. Tell the lexer this so any newlines we see will be
// converted into an EOM token (this terminates the macro).
CurPPLexer->ParsingPreprocessorDirective = true;
- CurLexer->SetCommentRetentionState(false);
+ if (CurLexer) CurLexer->SetCommentRetentionState(false);
// Read the next token, the directive flavor.
if (Tok.isNot(tok::identifier)) {
CurPPLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->SetCommentRetentionState(KeepComments);
+ if (CurLexer) CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
FirstChar != 'i' && FirstChar != 'e') {
CurPPLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->SetCommentRetentionState(KeepComments);
+ if (CurLexer) CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
if (IdLen >= 20) {
CurPPLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->SetCommentRetentionState(KeepComments);
+ if (CurLexer) CurLexer->SetCommentRetentionState(KeepComments);
continue;
}
memcpy(Directive, &DirectiveStr[0], IdLen);
CurPPLexer->ParsingPreprocessorDirective = false;
// Restore comment saving mode.
- CurLexer->SetCommentRetentionState(KeepComments);
+ if (CurLexer) CurLexer->SetCommentRetentionState(KeepComments);
}
// Finally, if we are out of the conditional (saw an #endif or ran off the end
// If we are supposed to keep comments in #defines, reenable comment saving
// mode.
- CurLexer->SetCommentRetentionState(KeepMacroComments);
+ if (CurLexer) CurLexer->SetCommentRetentionState(KeepMacroComments);
// Create the new macro.
MacroInfo *MI = new MacroInfo(MacroNameTok.getLocation());