diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index aa4626b20560..3eecc89a085a 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/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; }