From: Anna Zaks Date: Sat, 5 Nov 2011 05:20:59 +0000 (+0000) Subject: Another correction to the LiveVariables commit (r143767, r143780). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38f0b5a611a1776bb5996c56902b64549d093603;p=clang Another correction to the LiveVariables commit (r143767, r143780). Make test/Analysis/misc-ps.c test pass. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143790 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index ccb301e58e..aa4626b205 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -233,11 +233,15 @@ static const VariableArrayType *FindVA(QualType Ty) { static const Stmt *LookThroughStmt(const Stmt *S) { while (S) { - if (const ParenExpr *ParenE = dyn_cast(S)) + if (const ParenExpr *ParenE = dyn_cast(S)) { S = ParenE->getSubExpr(); - else if (const OpaqueValueExpr *OVE = dyn_cast(S)) + continue; + } else if (const OpaqueValueExpr *OVE = dyn_cast(S)) { S = OVE->getSourceExpr(); - else + continue; + } else if (const Expr *E = dyn_cast(S)) { + return E->IgnoreParens(); + } else break; } return S;