]> granicus.if.org Git - clang/commitdiff
Use IgnoreParenCasts.
authorAnders Carlsson <andersca@mac.com>
Wed, 13 Feb 2008 01:22:59 +0000 (01:22 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 13 Feb 2008 01:22:59 +0000 (01:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47041 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaChecking.cpp

index 1dfb145db85c744a063ed0d9af5baccef0f24c4f..fe82ea6b85fc6d164a2ca11a6f23149833386ce2 100644 (file)
@@ -149,15 +149,7 @@ bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) {
   // Verify that the second argument to the builtin is the last argument of the
   // current function or method.
   bool SecondArgIsLastNamedArgument = false;
-  const Expr *Arg = TheCall->getArg(1);
-  while (1) {
-    if (const ParenExpr *PE = dyn_cast<ParenExpr>(Arg))
-      Arg = PE->getSubExpr();
-    else if (const ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(Arg))
-      Arg = CE->getSubExpr();
-    else
-      break;
-  }
+  const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts();
   
   if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Arg)) {
     if (const ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) {