From 04994959a37501d74a49888a77986b92917ef869 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Sat, 5 Nov 2011 05:20:59 +0000 Subject: [PATCH] Another correction to the LiveVariables commit (r143767, r143780). Make test/Analysis/misc-ps.c test pass. llvm-svn: 143790 --- clang/lib/Analysis/LiveVariables.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index ccb301e58eba..aa4626b20560 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/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;