add a debug dump function for ValueLifetimeAnalysis

This commit is contained in:
Erik Eckstein
2016-04-13 13:22:30 -07:00
parent c01e8ede5b
commit 3e52d24853
2 changed files with 15 additions and 0 deletions

View File

@@ -1240,6 +1240,18 @@ bool ValueLifetimeAnalysis::isWithinLifetime(SILInstruction *Inst) {
llvm_unreachable("Expected to find use of value in block!");
}
void ValueLifetimeAnalysis::dump() const {
llvm::errs() << "lifetime of def: " << *DefValue;
for (SILInstruction *Use : UserSet) {
llvm::errs() << " use: " << *Use;
}
llvm::errs() << " live blocks:";
for (SILBasicBlock *BB : LiveBlocks) {
llvm::errs() << ' ' << BB->getDebugID();
}
llvm::errs() << '\n';
}
//===----------------------------------------------------------------------===//
// Casts Optimization and Simplification
//===----------------------------------------------------------------------===//