Skip to content

Commit 11c9fc0

Browse files
authored
Merge pull request #7591 from gottesmm/cleanupmanager_dump_cleanuphandle
2 parents 7927160 + 2d0ea18 commit 11c9fc0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/SILGen/Cleanup.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,10 @@ void CleanupManager::dump() const {
263263
}
264264
#endif
265265
}
266+
267+
void CleanupManager::dump(CleanupHandle handle) const {
268+
auto iter = Stack.find(handle);
269+
const Cleanup &stackCleanup = *iter;
270+
llvm::errs() << "CLEANUP DEPTH: " << handle.getDepth() << "\n";
271+
stackCleanup.dump(Gen);
272+
}

lib/SILGen/Cleanup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ class LLVM_LIBRARY_VISIBILITY CleanupManager {
204204

205205
/// Dump the output of each cleanup on this stack.
206206
void dump() const;
207+
208+
/// Dump the given cleanup handle if it is on the current stack.
209+
void dump(CleanupHandle handle) const;
207210
};
208211

209212
/// An RAII object that allows the state of a cleanup to be

0 commit comments

Comments
 (0)