From b7151c7ca8c4cfc6ddcf9ec324a259c11e2098a6 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 20 Mar 2008 21:46:49 +0000 Subject: 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 --- clang/lib/Analysis/LiveVariables.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'clang/lib/Analysis/LiveVariables.cpp') 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 Solver; + +struct Merge { + typedef ExprDeclBitVector_Types::ValTy ValTy; + + void operator()(ValTy& Dst, const ValTy& Src) { + Dst.OrDeclBits(Src); + Dst.AndExprBits(Src); + } +}; + +typedef DataflowSolver Solver; } // end anonymous namespace //===----------------------------------------------------------------------===// -- cgit v1.2.3