]> granicus.if.org Git - clang/commitdiff
Another correction to the LiveVariables commit (r143767, r143780).
authorAnna Zaks <ganna@apple.com>
Sat, 5 Nov 2011 05:20:59 +0000 (05:20 +0000)
committerAnna Zaks <ganna@apple.com>
Sat, 5 Nov 2011 05:20:59 +0000 (05:20 +0000)
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

lib/Analysis/LiveVariables.cpp

index ccb301e58ebacc3ea0b3889f9612b659d654d891..aa4626b20560920fbd7c05a783288e6c022addfe 100644 (file)
@@ -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<ParenExpr>(S))
+    if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) {
       S = ParenE->getSubExpr();
-    else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
+      continue;
+    } else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {
       S = OVE->getSourceExpr();
-    else
+      continue;
+    } else if (const Expr *E = dyn_cast<Expr>(S)) {
+      return E->IgnoreParens();
+    } else
       break;
   }
   return S;