Use IgnoreParenCasts.

llvm-svn: 47041
This commit is contained in:
Anders Carlsson 2008-02-13 01:22:59 +00:00
parent f26609686f
commit 73cc507602
1 changed files with 1 additions and 9 deletions

View 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())) {