]> granicus.if.org Git - clang/commitdiff
Simplify LookThroughStmt in LiveVariables.cpp
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 5 Nov 2011 07:03:54 +0000 (07:03 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 5 Nov 2011 07:03:54 +0000 (07:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LiveVariables.cpp

index aa4626b20560920fbd7c05a783288e6c022addfe..3eecc89a085a0306a80bf212042b4c8ca86f2ce4 100644 (file)
@@ -232,18 +232,10 @@ static const VariableArrayType *FindVA(QualType Ty) {
 }
 
 static const Stmt *LookThroughStmt(const Stmt *S) {
-  while (S) {
-    if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) {
-      S = ParenE->getSubExpr();
-      continue;
-    } else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {
-      S = OVE->getSourceExpr();
-      continue;
-    } else if (const Expr *E = dyn_cast<Expr>(S)) {
-      return E->IgnoreParens();
-    } else
-      break;
-  }
+  if (const Expr *E = dyn_cast<Expr>(S))
+    return E->IgnoreParens();
+  if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
+    return OVE->IgnoreParens();
   return S;
 }