diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-14 05:07:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-14 05:07:49 +0000 |
commit | ce2ab6f425f4241186d3af7d43b8f30ee93d044d (patch) | |
tree | d568984ce6ad02ced6b35c8a2b3a8c9786b313bb /clang/lib/Lex/PPDirectives.cpp | |
parent | 92bb846e2b940105d2920c46607b8fce25626dc5 (diff) | |
download | bcm5719-llvm-ce2ab6f425f4241186d3af7d43b8f30ee93d044d.tar.gz bcm5719-llvm-ce2ab6f425f4241186d3af7d43b8f30ee93d044d.zip |
Fix the #import / #include_next "extra tokens at end of #foo directive"
Warning to properly report that it is an import/include_next instead of
claiming it is a #include.
llvm-svn: 69023
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 24b943254cf..affd9886f02 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -243,7 +243,7 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc, } } 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); @@ -257,7 +257,7 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc, // #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. @@ -689,7 +689,7 @@ void Preprocessor::HandleLineDirective(Token &Tok) { Literal.GetStringLength()); // Verify that there is nothing after the string, other than EOM. - CheckEndOfDirective("#line"); + CheckEndOfDirective("line"); } SourceMgr.AddLineNote(DigitTok.getLocation(), LineNo, FilenameID); @@ -889,7 +889,7 @@ void Preprocessor::HandleIdentSCCSDirective(Token &Tok) { } // Verify that there is nothing after the string, other than EOM. - CheckEndOfDirective("#ident"); + CheckEndOfDirective("ident"); if (Callbacks) Callbacks->Ident(Tok.getLocation(), getSpelling(StrTok)); @@ -1050,7 +1050,7 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, } // 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) { @@ -1420,7 +1420,7 @@ void Preprocessor::HandleUndefDirective(Token &UndefTok) { 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()); @@ -1464,7 +1464,7 @@ void Preprocessor::HandleIfdefDirective(Token &Result, bool isIfndef, } // 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. @@ -1533,7 +1533,7 @@ void Preprocessor::HandleEndifDirective(Token &EndifToken) { ++NumEndif; // Check that this is the whole directive. - CheckEndOfDirective("#endif"); + CheckEndOfDirective("endif"); PPConditionalInfo CondInfo; if (CurPPLexer->popConditionalLevel(CondInfo)) { @@ -1555,7 +1555,7 @@ void Preprocessor::HandleElseDirective(Token &Result) { ++NumElse; // #else directive in a non-skipping conditional... start skipping. - CheckEndOfDirective("#else"); + CheckEndOfDirective("else"); PPConditionalInfo CI; if (CurPPLexer->popConditionalLevel(CI)) { |