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
This commit is contained in:
Ted Kremenek
2008-03-20 21:46:49 +00:00
parent 5ca2ea6479
commit b7151c7ca8
2 changed files with 30 additions and 3 deletions

View File

@@ -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
//===----------------------------------------------------------------------===//