File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -894,6 +894,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
894
894
llvm::SmallVector<SILValue, 8 > values;
895
895
llvm::copy (inst->getResults (), std::back_inserter (values));
896
896
printUserList (values, inst);
897
+ printBranchTargets (inst);
897
898
}
898
899
899
900
void printUserList (ArrayRef<SILValue> values, SILNodePointer node) {
@@ -937,6 +938,21 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
937
938
[&] { *this << " , " ; });
938
939
}
939
940
941
+ void printBranchTargets (const SILInstruction *inst) {
942
+ if (auto condBr = dyn_cast<CondBranchInst>(inst)) {
943
+ if (condBr->getTrueBB ()->getDebugName ().hasValue ()) {
944
+ *this << " , true->" << condBr->getTrueBB ()->getDebugName ().getValue ();
945
+ }
946
+ if (condBr->getFalseBB ()->getDebugName ().hasValue ()) {
947
+ *this << " , false->" << condBr->getFalseBB ()->getDebugName ().getValue ();
948
+ }
949
+ } else if (auto br = dyn_cast<BranchInst>(inst)) {
950
+ if (br->getDestBB ()->getDebugName ().hasValue ()) {
951
+ *this << " , dest->" << br->getDestBB ()->getDebugName ().getValue ();
952
+ }
953
+ }
954
+ }
955
+
940
956
void printConformances (ArrayRef<ProtocolConformanceRef> conformances) {
941
957
// FIXME: conformances should always be printed and parsed!
942
958
if (!Ctx.printVerbose ()) {
You can’t perform that action at this time.
0 commit comments