Skip to content

Commit b63770b

Browse files
committed
also handle general successors
1 parent e72eb0d commit b63770b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/SIL/IR/SILPrinter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,16 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
950950
if (br->getDestBB()->getDebugName().hasValue()) {
951951
*this << ", dest->" << br->getDestBB()->getDebugName().getValue();
952952
}
953+
} else if (auto termInst = dyn_cast<TermInst>(inst)) {
954+
// Otherwise, we just print the successors in order without pretty printing
955+
for (unsigned i = 0, numSuccessors = termInst->getSuccessors().size();
956+
i != numSuccessors; ++i) {
957+
auto &successor = termInst->getSuccessors()[i];
958+
if (successor.getBB()->getDebugName().hasValue()) {
959+
*this << ", #" << i
960+
<< "->" << successor.getBB()->getDebugName().getValue();
961+
}
962+
}
953963
}
954964
}
955965

0 commit comments

Comments
 (0)