diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-20 21:46:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-20 21:46:49 +0000 |
commit | b7151c7ca8c4cfc6ddcf9ec324a259c11e2098a6 (patch) | |
tree | d67df702c941d346b2a9906f882785ede5248269 /clang/lib/Analysis/LiveVariables.cpp | |
parent | 5ca2ea6479ad84b6e3d45f77a23fb9325ba5dc9a (diff) | |
download | bcm5719-llvm-b7151c7ca8c4cfc6ddcf9ec324a259c11e2098a6.tar.gz bcm5719-llvm-b7151c7ca8c4cfc6ddcf9ec324a259c11e2098a6.zip |
LiveVariables analysis now uses intersect for the merge of block-level expression liveness information.
The rationale is that a block-level expression cannot be live in a parent block unless it is live in all of the successor blocks.
llvm-svn: 48618
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index e59a4885911..acc13dead85 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -168,8 +168,17 @@ void TransferFuncs::VisitDeclStmt(DeclStmt* DS) { //===----------------------------------------------------------------------===// namespace { -typedef ExprDeclBitVector_Types::Union Merge; -typedef DataflowSolver<LiveVariables,TransferFuncs,Merge> Solver; + +struct Merge { + typedef ExprDeclBitVector_Types::ValTy ValTy; + + void operator()(ValTy& Dst, const ValTy& Src) { + Dst.OrDeclBits(Src); + Dst.AndExprBits(Src); + } +}; + +typedef DataflowSolver<LiveVariables, TransferFuncs, Merge> Solver; } // end anonymous namespace //===----------------------------------------------------------------------===// |