diff options
author | Alp Toker <alp@nuanti.com> | 2013-12-30 01:59:29 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-12-30 01:59:29 +0000 |
commit | fb6edef8552edd84bd04df0dca5a543cd5e88943 (patch) | |
tree | 934c86a7cdfb34007a36d9a93977ca73c0afc2a1 /lib/Lex | |
parent | 4eabbac65ae4437c501ab29bb36ae5215e3689c8 (diff) |
Cleanup: Switch the preprocessor to err_pp_expected_after
This is approaching consistency but the PP and Parse categories they still have
slightly different wording:
def err_pp_expected_after : Error<"missing %1 after %0">;
def err_expected_after : Error<"expected %1 after %0">;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 3 | ||||
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index c561ec790e..09d87de86b 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -130,7 +130,8 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT, PP.LexUnexpandedNonComment(PeekTok); if (PeekTok.isNot(tok::r_paren)) { - PP.Diag(PeekTok.getLocation(), diag::err_pp_missing_rparen) << "defined"; + PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_after) + << "'defined'" << tok::r_paren; PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren; return true; } diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 8ad11c0a6b..5aefa5a771 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1080,7 +1080,7 @@ static bool EvaluateHasIncludeCommon(Token &Tok, if (Tok.isNot(tok::l_paren)) { // No '(', use end of last token. LParenLoc = PP.getLocForEndOfToken(LParenLoc); - PP.Diag(LParenLoc, diag::err_pp_missing_lparen) << II->getName(); + PP.Diag(LParenLoc, diag::err_pp_expected_after) << II << tok::l_paren; // If the next token looks like a filename or the start of one, // assume it is and process it as such. if (!Tok.is(tok::angle_string_literal) && !Tok.is(tok::string_literal) && @@ -1142,8 +1142,8 @@ static bool EvaluateHasIncludeCommon(Token &Tok, // Ensure we have a trailing ). if (Tok.isNot(tok::r_paren)) { - PP.Diag(PP.getLocForEndOfToken(FilenameLoc), diag::err_pp_missing_rparen) - << II->getName(); + PP.Diag(PP.getLocForEndOfToken(FilenameLoc), diag::err_pp_expected_after) + << II << tok::r_paren; PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren; return false; } @@ -1201,7 +1201,8 @@ static bool EvaluateBuildingModule(Token &Tok, // Ensure we have a '('. if (Tok.isNot(tok::l_paren)) { - PP.Diag(Tok.getLocation(), diag::err_pp_missing_lparen) << II->getName(); + PP.Diag(Tok.getLocation(), diag::err_pp_expected_after) << II + << tok::l_paren; return false; } @@ -1225,7 +1226,8 @@ static bool EvaluateBuildingModule(Token &Tok, // Ensure we have a trailing ). if (Tok.isNot(tok::r_paren)) { - PP.Diag(Tok.getLocation(), diag::err_pp_missing_rparen) << II->getName(); + PP.Diag(Tok.getLocation(), diag::err_pp_expected_after) << II + << tok::r_paren; PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren; return false; } |