switch statement, not the while loop).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143780
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
}