Author: lattner
Date: Sun Jan  4 16:28:21 2009
New Revision: 61641

URL: http://llvm.org/viewvc/llvm-project?rev=61641&view=rev
Log:
simplify control flow by removing a goto.

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

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

==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Sun Jan  4 16:28:21 2009
@@ -602,11 +602,13 @@
   case tok::kw_float:
   case tok::kw_double:
   case tok::kw_void:
-  case tok::kw_typeof: {
-    if (!getLang().CPlusPlus)
-      goto UnhandledToken;
-  case tok::annot_qualtypename:
-    assert(getLang().CPlusPlus && "Expected C++");
+  case tok::kw_typeof:
+  case tok::annot_qualtypename: {
+    if (!getLang().CPlusPlus) {
+      Diag(Tok, diag::err_expected_expression);
+      return ExprError();
+    }
+    
     // postfix-expression: simple-type-specifier '(' expression-list[opt] ')'
     //
     DeclSpec DS;
@@ -657,9 +659,8 @@
     // These can be followed by postfix-expr pieces.
     if (getLang().ObjC1)
       return ParsePostfixExpressionSuffix(ParseObjCMessageExpression());
-    // FALL THROUGH.
+    // FALL THROUGH.      
   default:
-  UnhandledToken:
     Diag(Tok, diag::err_expected_expression);
     return ExprError();
   }


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to