Simplify LookThroughStmt in LiveVariables.cpp

llvm-svn: 143794
This commit is contained in:
Argyrios Kyrtzidis 2011-11-05 07:03:54 +00:00
parent 6437126f19
commit 6b4fa1b4d6
1 changed files with 4 additions and 12 deletions

View 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)) {
if (const Expr *E = dyn_cast<Expr>(S))
return E->IgnoreParens();
} else
break;
}
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
return OVE->IgnoreParens();
return S;
}