]> granicus.if.org Git - clang/commitdiff
We don't add ExprWithCleanups to the CFG, and getSVal looks
authorJohn McCall <rjmccall@apple.com>
Wed, 9 Nov 2011 17:10:36 +0000 (17:10 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 9 Nov 2011 17:10:36 +0000 (17:10 +0000)
through it, so we should look through it for the live-values
analysis as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LiveVariables.cpp

index f0dbc532b2e129267c02524fde3d923a693576e0..3a325009d4a2b8b3ded02e4775b012aa1abe2135 100644 (file)
@@ -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;