[cfe-commits] r47041 - /cfe/trunk/Sema/SemaChecking.cpp
Anders Carlsson
andersca at mac.com
Tue Feb 12 17:22:59 PST 2008
Author: andersca
Date: Tue Feb 12 19:22:59 2008
New Revision: 47041
URL: http://llvm.org/viewvc/llvm-project?rev=47041&view=rev
Log:
Use IgnoreParenCasts.
Modified:
cfe/trunk/Sema/SemaChecking.cpp
Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=47041&r1=47040&r2=47041&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Tue Feb 12 19:22:59 2008
@@ -149,15 +149,7 @@
// 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())) {
More information about the cfe-commits
mailing list