aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-18 05:56:09 +0000
committerChris Lattner <sabre@nondot.org>2009-02-18 05:56:09 +0000
commit97cf6eb380016db868866faf27a086cd55a316d4 (patch)
tree5ef9d0010f16adb6e4affc87bd3fe4b70dd49e51 /lib/Parse/ParseObjc.cpp
parent726e168dc09fb23f53c7b004f8e919421ee91806 (diff)
simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 4e4d009fe0..a147ee47e8 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1600,12 +1600,10 @@ Parser::OwningExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
AtLocs.push_back(ConsumeToken()); // eat the @.
// Invalid unless there is a string literal.
- OwningExprResult Lit(Actions, true);
- if (isTokenStringLiteral())
- Lit = ParseStringLiteralExpression();
- else
- Diag(Tok, diag::err_objc_concat_string);
+ if (!isTokenStringLiteral())
+ return ExprError(Diag(Tok, diag::err_objc_concat_string));
+ OwningExprResult Lit(ParseStringLiteralExpression());
if (Lit.isInvalid())
return move(Lit);