[silgen] Create CleanupManager::dump and the relevant dump methods to dump the current cleanups.

This is useful to discover when a specific cleanup is being eliminated while
debugging. The implementation is compiled out when assertions are disabled.

rdar://29791263
This commit is contained in:
Michael Gottesman
2017-01-28 19:14:41 -08:00
parent d81d37694d
commit e192b56a88
9 changed files with 143 additions and 1 deletions

View File

@@ -746,6 +746,12 @@ namespace {
void emit(SILGenFunction &gen, CleanupLocation loc) override {
gen.B.createDeallocValueBuffer(loc, ValueType, Buffer);
}
void dump() const override {
#ifndef NDEBUG
llvm::errs() << "DeallocateValueBuffer\n"
<< "State: " << getState() << "Buffer: " << Buffer << "\n";
#endif
}
};
} // end anonymous namespace