]> granicus.if.org Git - clang/commitdiff
Tweak LookThroughStmt() in LiveVariables to properly look through alternativing Paren...
authorTed Kremenek <kremenek@apple.com>
Sat, 5 Nov 2011 07:34:28 +0000 (07:34 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 5 Nov 2011 07:34:28 +0000 (07:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143797 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LiveVariables.cpp

index 69b093304268cfc089c584736a0b146b66b79828..cd6f09f2a744863cad9bfc935301bd8a5a76ba55 100644 (file)
@@ -232,10 +232,15 @@ static const VariableArrayType *FindVA(QualType Ty) {
 }
 
 static const Stmt *LookThroughStmt(const Stmt *S) {
-  if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
-    return OVE->getSourceExpr()->IgnoreParens();
-  if (const Expr *E = dyn_cast<Expr>(S))
-    return E->IgnoreParens();
+  while (S) {
+    if (const Expr *Ex = dyn_cast<Expr>(S))
+      S = Ex->IgnoreParens();    
+    if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {
+      S = OVE->getSourceExpr();
+      continue;
+    }
+    break;
+  }
   return S;
 }