aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVariables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-03-20 21:46:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-03-20 21:46:49 +0000
commitfa59f1f053235e9adf32425f2b6049185771246d (patch)
treed3b6aa5a9fe1b93062a6a08ac676d600f6bf0475 /lib/Analysis/LiveVariables.cpp
parent4c0c97dd5457ea4c79f44efc90b151a5775a1f0a (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r--lib/Analysis/LiveVariables.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp
index e59a488591..acc13dead8 100644
--- a/lib/Analysis/LiveVariables.cpp
+++ b/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
//===----------------------------------------------------------------------===//