]> granicus.if.org Git - clang/commitdiff
reduce nesting.
authorChris Lattner <sabre@nondot.org>
Sat, 14 Feb 2009 07:22:29 +0000 (07:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 Feb 2009 07:22:29 +0000 (07:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64542 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index cec771d4e5145e051a06db59e2cf770fd358efce..ee3ef04084e1c125ed7d7853dfd3a8bb21bf0927 100644 (file)
@@ -1897,21 +1897,18 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
                cast<UnaryOperator>(FnExpr)->getOpcode() 
                  == UnaryOperator::AddrOf) {
       FnExpr = cast<UnaryOperator>(FnExpr)->getSubExpr();
+    } else if ((DRExpr = dyn_cast<DeclRefExpr>(FnExpr))) {
+      // Qualified names disable ADL (C++0x [basic.lookup.argdep]p1).
+      ADL &= !isa<QualifiedDeclRefExpr>(DRExpr);
+      break;
+    } else if (UnresolvedFunctionNameExpr *DepName 
+                 = dyn_cast<UnresolvedFunctionNameExpr>(FnExpr)) {
+      UnqualifiedName = DepName->getName();
+      break;
     } else {
-      if (isa<DeclRefExpr>(FnExpr)) {
-        DRExpr = cast<DeclRefExpr>(FnExpr);
-
-        // Qualified names disable ADL (C++0x [basic.lookup.argdep]p1).
-        ADL = ADL && !isa<QualifiedDeclRefExpr>(DRExpr);
-      }
-      else if (UnresolvedFunctionNameExpr *DepName 
-                 = dyn_cast<UnresolvedFunctionNameExpr>(FnExpr))
-        UnqualifiedName = DepName->getName();
-      else {
-        // Any kind of name that does not refer to a declaration (or
-        // set of declarations) disables ADL (C++0x [basic.lookup.argdep]p3).
-        ADL = false;
-      }
+      // Any kind of name that does not refer to a declaration (or
+      // set of declarations) disables ADL (C++0x [basic.lookup.argdep]p3).
+      ADL = false;
       break;
     }
   }