diff options
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 0b5a236bed..ccb301e58e 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -233,18 +233,12 @@ static const VariableArrayType *FindVA(QualType Ty) { static const Stmt *LookThroughStmt(const Stmt *S) { while (S) { - switch (S->getStmtClass()) { - case Stmt::ParenExprClass: { - S = cast<ParenExpr>(S)->getSubExpr(); - continue; - } - case Stmt::OpaqueValueExprClass: { - S = cast<OpaqueValueExpr>(S)->getSourceExpr(); - continue; - } - default: - break; - } + if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) + S = ParenE->getSubExpr(); + else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) + S = OVE->getSourceExpr(); + else + break; } return S; } |