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) { static const Stmt *LookThroughStmt(const Stmt *S) {
while (S) { if (const Expr *E = dyn_cast<Expr>(S))
if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) { return E->IgnoreParens();
S = ParenE->getSubExpr(); if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
continue; return OVE->IgnoreParens();
} 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;
}
return S; return S;
} }