}
} else if (FirstChar == 'e') {
if (IdLen == 5 && !strcmp(Directive+1, "ndif")) { // "endif"
- CheckEndOfDirective("#endif");
+ CheckEndOfDirective("endif");
PPConditionalInfo CondInfo;
CondInfo.WasSkipping = true; // Silence bogus warning.
bool InCond = CurPPLexer->popConditionalLevel(CondInfo);
// #else directive in a skipping conditional. If not in some other
// skipping conditional, and if #else hasn't already been seen, enter it
// as a non-skipping conditional.
- CheckEndOfDirective("#else");
+ CheckEndOfDirective("else");
PPConditionalInfo &CondInfo = CurPPLexer->peekConditionalLevel();
// If this is a #else with a #else before it, report the error.
Literal.GetStringLength());
// Verify that there is nothing after the string, other than EOM.
- CheckEndOfDirective("#line");
+ CheckEndOfDirective("line");
}
SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID);
}
// Verify that there is nothing after the string, other than EOM.
- CheckEndOfDirective("#ident");
+ CheckEndOfDirective("ident");
if (Callbacks)
Callbacks->Ident(Tok.getLocation(), getSpelling(StrTok));
}
// Verify that there is nothing after the filename, other than EOM.
- CheckEndOfDirective("#include");
+ CheckEndOfDirective(IncludeTok.getIdentifierInfo()->getName());
// Check that we don't have infinite #include recursion.
if (IncludeMacroStack.size() == MaxAllowedIncludeStackDepth-1) {
return;
// Check to see if this is the last token on the #undef line.
- CheckEndOfDirective("#undef");
+ CheckEndOfDirective("undef");
// Okay, we finally have a valid identifier to undef.
MacroInfo *MI = getMacroInfo(MacroNameTok.getIdentifierInfo());
}
// Check to see if this is the last token on the #if[n]def line.
- CheckEndOfDirective(isIfndef ? "#ifndef" : "#ifdef");
+ CheckEndOfDirective(isIfndef ? "ifndef" : "ifdef");
if (CurPPLexer->getConditionalStackDepth() == 0) {
// If the start of a top-level #ifdef, inform MIOpt.
++NumEndif;
// Check that this is the whole directive.
- CheckEndOfDirective("#endif");
+ CheckEndOfDirective("endif");
PPConditionalInfo CondInfo;
if (CurPPLexer->popConditionalLevel(CondInfo)) {
++NumElse;
// #else directive in a non-skipping conditional... start skipping.
- CheckEndOfDirective("#else");
+ CheckEndOfDirective("else");
PPConditionalInfo CI;
if (CurPPLexer->popConditionalLevel(CI)) {
struct PragmaOnceHandler : public PragmaHandler {
PragmaOnceHandler(const IdentifierInfo *OnceID) : PragmaHandler(OnceID) {}
virtual void HandlePragma(Preprocessor &PP, Token &OnceTok) {
- PP.CheckEndOfDirective("#pragma once");
+ PP.CheckEndOfDirective("pragma once");
PP.HandlePragmaOnce(OnceTok);
}
};
PragmaSystemHeaderHandler(const IdentifierInfo *ID) : PragmaHandler(ID) {}
virtual void HandlePragma(Preprocessor &PP, Token &SHToken) {
PP.HandlePragmaSystemHeader(SHToken);
- PP.CheckEndOfDirective("#pragma");
+ PP.CheckEndOfDirective("pragma");
}
};
struct PragmaDependencyHandler : public PragmaHandler {