Skip to content

Commit 5ef8f3b

Browse files
committed
[sil-verifier] Add a dump method to BBState for FlowSensitiveVerification.
Just to make it easier to diagnose problems in the debugger.
1 parent c739308 commit 5ef8f3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/SIL/Verifier/FlowSensitiveVerifier.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ struct BBState {
5050
BBState(maybe_movable_ref<BBState> other)
5151
: BBState(std::move(other).construct()) {}
5252

53+
/// Print for dumping all information.
54+
void print(llvm::raw_ostream &os) const {
55+
SILPrintContext ctx(os);
56+
printStack(ctx, "stack");
57+
printActiveOps(ctx, "active_ops");
58+
}
59+
60+
SWIFT_DEBUG_DUMP { print(llvm::dbgs()); }
61+
5362
void printStack(SILPrintContext &ctx, StringRef label) const {
5463
ctx.OS() << label << ": [";
5564
if (!Stack.empty())

0 commit comments

Comments
 (0)