From 4fe6441a558e471f2ad3c6bddf07c77332539f6b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 9 Sep 2010 03:51:39 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaChecking.cpp | 12 +++++------- 1 file 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(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast(E)->getSubExpr(); + goto tryAgain; } case Stmt::ParenExprClass: { - const ParenExpr *Expr = cast(E); - return SemaCheckStringLiteral(Expr->getSubExpr(), TheCall, HasVAListArg, - format_idx, firstDataArg, isPrintf); + E = cast(E)->getSubExpr(); + goto tryAgain; } case Stmt::DeclRefExprClass: { -- 2.40.0