summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-09 17:10:36 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-09 17:10:36 +0000
commit29928fc56304ca201fd43f1e9be8b1c9d30761ed (patch)
tree0e3dd1cf120fe11686b8a243e055812717bb6c2a /clang/lib/Analysis/LiveVariables.cpp
parent7240a9528246208488ccc6326ab21674026f302d (diff)
downloadbcm5719-llvm-29928fc56304ca201fd43f1e9be8b1c9d30761ed.tar.gz
bcm5719-llvm-29928fc56304ca201fd43f1e9be8b1c9d30761ed.zip
We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values analysis as well. llvm-svn: 144190
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r--clang/lib/Analysis/LiveVariables.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp
index f0dbc532b2e..3a325009d4a 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -235,6 +235,10 @@ static const Stmt *LookThroughStmt(const Stmt *S) {
while (S) {
if (const Expr *Ex = dyn_cast<Expr>(S))
S = Ex->IgnoreParens();
+ if (const ExprWithCleanups *EWC = dyn_cast<ExprWithCleanups>(S)) {
+ S = EWC->getSubExpr();
+ continue;
+ }
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {
S = OVE->getSourceExpr();
continue;
OpenPOWER on IntegriCloud