mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -405,6 +405,12 @@ namespace {
|
||||
void emit(SILGenFunction &SGF, CleanupLocation l) override {
|
||||
assert(false && "Sema didn't catch exit out of a defer?");
|
||||
}
|
||||
void dump() const override {
|
||||
#ifndef NDEBUG
|
||||
llvm::errs() << "DeferEscapeCheckerCleanup\n"
|
||||
<< "State: " << getState() << "\n";
|
||||
#endif
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
@@ -425,6 +431,12 @@ namespace {
|
||||
if (SGF.B.hasValidInsertionPoint())
|
||||
SGF.Cleanups.setCleanupState(TheCleanup, CleanupState::Dead);
|
||||
}
|
||||
void dump() const override {
|
||||
#ifndef NDEBUG
|
||||
llvm::errs() << "DeferCleanup\n"
|
||||
<< "State: " << getState() << "\n";
|
||||
#endif
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user