From: Anders Carlsson Date: Wed, 13 Feb 2008 01:22:59 +0000 (+0000) Subject: Use IgnoreParenCasts. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2c14103dec39cbd24dac9d7b3e91277b109c14f;p=clang Use IgnoreParenCasts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47041 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp index 1dfb145db8..fe82ea6b85 100644 --- a/Sema/SemaChecking.cpp +++ b/Sema/SemaChecking.cpp @@ -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(Arg)) - Arg = PE->getSubExpr(); - else if (const ImplicitCastExpr *CE = dyn_cast(Arg)) - Arg = CE->getSubExpr(); - else - break; - } + const Expr *Arg = TheCall->getArg(1)->IgnoreParenCasts(); if (const DeclRefExpr *DR = dyn_cast(Arg)) { if (const ParmVarDecl *PV = dyn_cast(DR->getDecl())) {