diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-05 07:03:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-05 07:03:54 +0000 |
commit | 74b5edd7a23e493a968dbe3d6a05974dc62892ad (patch) | |
tree | 7c46d398697b4fcc85a990b2262acbd726095882 /lib/Analysis/LiveVariables.cpp | |
parent | 32bae37b821e6ade738849ac14e3d3de06afb0be (diff) |
Simplify LookThroughStmt in LiveVariables.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index aa4626b205..3eecc89a08 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -232,18 +232,10 @@ static const VariableArrayType *FindVA(QualType Ty) { } static const Stmt *LookThroughStmt(const Stmt *S) { - while (S) { - if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) { - S = ParenE->getSubExpr(); - continue; - } 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; - } + if (const Expr *E = dyn_cast<Expr>(S)) + return E->IgnoreParens(); + if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) + return OVE->IgnoreParens(); return S; } |