Make test/Analysis/misc-ps.c test pass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143790
91177308-0d34-0410-b5e6-
96231b3b80d8
static const Stmt *LookThroughStmt(const Stmt *S) {
while (S) {
- if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S))
+ if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) {
S = ParenE->getSubExpr();
- else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))
+ continue;
+ } else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {
S = OVE->getSourceExpr();
- else
+ continue;
+ } else if (const Expr *E = dyn_cast<Expr>(S)) {
+ return E->IgnoreParens();
+ } else
break;
}
return S;