Simplify LookThroughStmt in LiveVariables.cpp
llvm-svn: 143794
This commit is contained in:
parent
6437126f19
commit
6b4fa1b4d6
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue