From: Argyrios Kyrtzidis Date: Sat, 5 Nov 2011 07:03:54 +0000 (+0000) Subject: Simplify LookThroughStmt in LiveVariables.cpp X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74b5edd7a23e493a968dbe3d6a05974dc62892ad;p=clang Simplify LookThroughStmt in LiveVariables.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index aa4626b205..3eecc89a08 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -232,18 +232,10 @@ static const VariableArrayType *FindVA(QualType Ty) { } static const Stmt *LookThroughStmt(const Stmt *S) { - while (S) { - if (const ParenExpr *ParenE = dyn_cast(S)) { - S = ParenE->getSubExpr(); - continue; - } else if (const OpaqueValueExpr *OVE = dyn_cast(S)) { - S = OVE->getSourceExpr(); - continue; - } else if (const Expr *E = dyn_cast(S)) { - return E->IgnoreParens(); - } else - break; - } + if (const Expr *E = dyn_cast(S)) + return E->IgnoreParens(); + if (const OpaqueValueExpr *OVE = dyn_cast(S)) + return OVE->IgnoreParens(); return S; }