]> granicus.if.org Git - clang/commitdiff
simplify some code.
authorChris Lattner <sabre@nondot.org>
Wed, 18 Feb 2009 05:56:09 +0000 (05:56 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Feb 2009 05:56:09 +0000 (05:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64893 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseObjc.cpp

index 4e4d009fe06f0ac39d65d2ff7b36c1480a5c9340..a147ee47e82c9a7acba66cd35cb786afa952eeba 100644 (file)
@@ -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);