[cfe-commits] r49267 - /cfe/trunk/lib/Parse/ParseExprCXX.cpp

Chris Lattner sabre at nondot.org
Sat Apr 5 23:03:04 PDT 2008


Author: lattner
Date: Sun Apr  6 01:03:03 2008
New Revision: 49267

URL: http://llvm.org/viewvc/llvm-project?rev=49267&view=rev
Log:
minor simplification

Modified:
    cfe/trunk/lib/Parse/ParseExprCXX.cpp

Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=49267&r1=49266&r2=49267&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Sun Apr  6 01:03:03 2008
@@ -83,10 +83,8 @@
 ///         'throw' assignment-expression[opt]
 Parser::ExprResult Parser::ParseThrowExpression() {
   assert(Tok.is(tok::kw_throw) && "Not throw!");
-
-  ExprResult Expr;
-
   SourceLocation ThrowLoc = ConsumeToken();           // Eat the throw token.
+  
   // If the current token isn't the start of an assignment-expression,
   // then the expression is not present.  This handles things like:
   //   "C ? throw : (void)42", which is crazy but legal.
@@ -100,7 +98,7 @@
     return Actions.ActOnCXXThrow(ThrowLoc);
 
   default:
-    Expr = ParseAssignmentExpression();
+    ExprResult Expr = ParseAssignmentExpression();
     if (Expr.isInvalid) return Expr;
     return Actions.ActOnCXXThrow(ThrowLoc, Expr.Val);
   }





More information about the cfe-commits mailing list