]> granicus.if.org Git - clang/commitdiff
simplify logic.
authorChris Lattner <sabre@nondot.org>
Sun, 6 Dec 2009 18:34:27 +0000 (18:34 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Dec 2009 18:34:27 +0000 (18:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90712 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/Parser.cpp

index 8e6e0feb1298c1384a01160e7acf10e0045f94fa..ca425e8b0528d9ed1e07f42d2aa42147b6d3d82b 100644 (file)
@@ -507,12 +507,13 @@ bool Parser::isDeclarationAfterDeclarator() {
 /// \brief Determine whether the current token, if it occurs after a
 /// declarator, indicates the start of a function definition.
 bool Parser::isStartOfFunctionDefinition() {
-  return Tok.is(tok::l_brace) ||    // int X() {}
-    (!getLang().CPlusPlus &&
-     isDeclarationSpecifier()) ||   // int X(f) int f; {}
-    (getLang().CPlusPlus &&
-     (Tok.is(tok::colon) ||         // X() : Base() {} (used for ctors)
-      Tok.is(tok::kw_try)));        // X() try { ... }
+  if (Tok.is(tok::l_brace))   // int X() {}
+    return true;
+  
+  if (!getLang().CPlusPlus)
+    return isDeclarationSpecifier();   // int X(f) int f; {}
+  return Tok.is(tok::colon) ||         // X() : Base() {} (used for ctors)
+         Tok.is(tok::kw_try);          // X() try { ... }
 }
 
 /// ParseDeclarationOrFunctionDefinition - Parse either a function-definition or