aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-18 07:48:38 +0000
committerChris Lattner <sabre@nondot.org>2008-11-18 07:48:38 +0000
commit1ab3b96de160e4fbffec2a776e284a48a3bb543d (patch)
tree9ab728aaab0602c9e14a93602a50d62932a74f5e /lib/Parse/ParseExpr.cpp
parentd3b64655fa81ff1e1d5f944198239e4908035d79 (diff)
Change a couple of the Parser::Diag methods to return DiagnosticInfo
and let the clients push whatever they want into the DiagnosticInfo instead of hard coding a few forms. Also switch various clients to use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the canonical form to simplify the code a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 467eef03b6..32a7c0a060 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -270,7 +270,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, unsigned MinPrec) {
if (Tok.isNot(tok::colon)) {
Diag(Tok, diag::err_expected_colon);
- Diag(OpToken, diag::err_matching, "?");
+ Diag(OpToken, diag::err_matching) << "?";
Actions.DeleteExpr(LHS.Val);
Actions.DeleteExpr(TernaryMiddle.Val);
return ExprResult(true);
@@ -599,8 +599,8 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
DeclSpec DS;
ParseCXXSimpleTypeSpecifier(DS);
if (Tok.isNot(tok::l_paren))
- return Diag(Tok.getLocation(), diag::err_expected_lparen_after_type,
- DS.getSourceRange());
+ return Diag(Tok, diag::err_expected_lparen_after_type)
+ << DS.getSourceRange();
Res = ParseCXXTypeConstructExpression(DS);
// This can be followed by postfix-expr pieces.
@@ -808,7 +808,7 @@ Parser::ExprResult Parser::ParseBuiltinPrimaryExpression() {
// All of these start with an open paren.
if (Tok.isNot(tok::l_paren)) {
- Diag(Tok, diag::err_expected_lparen_after, BuiltinII->getName());
+ Diag(Tok, diag::err_expected_lparen_after) << BuiltinII->getName();
return ExprResult(true);
}