diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-09 03:51:39 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-09 03:51:39 +0000 |
commit | 4fe6441a558e471f2ad3c6bddf07c77332539f6b (patch) | |
tree | 3ce98b872bf0b5f68e6ecd5da27bd78609bdde72 /lib/Sema/SemaChecking.cpp | |
parent | e0ba9d1beeba01a96808c2fc61f9ca89acec313b (diff) |
Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
and trying again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 7b0941e34b..6092348004 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -942,7 +942,7 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, bool HasVAListArg, unsigned format_idx, unsigned firstDataArg, bool isPrintf) { - + tryAgain: if (E->isTypeDependent() || E->isValueDependent()) return false; @@ -956,15 +956,13 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, } case Stmt::ImplicitCastExprClass: { - const ImplicitCastExpr *Expr = cast<ImplicitCastExpr>(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast<ImplicitCastExpr>(E)->getSubExpr(); + goto tryAgain; } case Stmt::ParenExprClass: { - const ParenExpr *Expr = cast<ParenExpr>(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast<ParenExpr>(E)->getSubExpr(); + goto tryAgain; } case Stmt::DeclRefExprClass: { |