diff options
author | Jordy Rose <jediknil@belkadan.com> | 2011-06-10 08:49:37 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2011-06-10 08:49:37 +0000 |
commit | ac73ea8c12772fd0dcec71b83c193a2837de7f8b (patch) | |
tree | f7badf7b6b5a5dd2b66832b21f9ad8ca51d51b84 /lib/Analysis/LiveVariables.cpp | |
parent | c530d1758cef1acc596f2ec905665da534e66d29 (diff) |
[analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level expressions (by calling IgnoreParens before adding expressions to blocks). Undo 132769 (LiveVariables' local IgnoreParens), since it's no longer necessary.
Also, have Environment stop looking through NoOp casts; it didn't match the behavior of LiveVariables. And once that's gone, the whole cast block of that switch is unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 0fe87e8719..7b36f85ab6 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -142,12 +142,8 @@ void TransferFuncs::Visit(Stmt *S) { if (AD.Observer) AD.Observer->ObserveStmt(S, currentBlock, AD, LiveState); - if (getCFG().isBlkExpr(S)) { - if (Expr *E = dyn_cast<Expr>(S)) - LiveState(E->IgnoreParens(), AD) = Dead; - else - LiveState(S, AD) = Dead; - } + if (getCFG().isBlkExpr(S)) + LiveState(S, AD) = Dead; StmtVisitor<TransferFuncs,void>::Visit(S); } @@ -161,10 +157,7 @@ void TransferFuncs::Visit(Stmt *S) { } else { // For block-level expressions, mark that they are live. - if (Expr *E = dyn_cast<Expr>(S)) - LiveState(E->IgnoreParens(), AD) = Alive; - else - LiveState(S, AD) = Alive; + LiveState(S, AD) = Alive; } } @@ -181,9 +174,6 @@ void TransferFuncs::VisitTerminator(CFGBlock* B) { return; assert (getCFG().isBlkExpr(E)); - - if (const Expr *Ex = dyn_cast<Expr>(E)) - E = Ex->IgnoreParens(); LiveState(E, AD) = Alive; } |