Skip to content

Commit f385834

Browse files
committed
[sil] When the immutable address use verifier errors due to an unknown instruction, print the instruction to improve debuggability.
1 parent f966020 commit f385834

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,10 @@ struct ImmutableAddressUseVerifier {
494494
while (!worklist.empty()) {
495495
auto *use = worklist.pop_back_val();
496496
auto *inst = use->getUser();
497+
497498
if (inst->isTypeDependentOperand(*use))
498499
continue;
500+
499501
switch (inst->getKind()) {
500502
case SILInstructionKind::MarkDependenceInst:
501503
case SILInstructionKind::LoadBorrowInst:
@@ -577,7 +579,8 @@ struct ImmutableAddressUseVerifier {
577579
}
578580
break;
579581
default:
580-
llvm_unreachable("Unhandled unexpected instruction");
582+
llvm::errs() << "Unhandled, unexpected instruction: " << *inst;
583+
llvm_unreachable("invoking standard assertion failure");
581584
break;
582585
}
583586
}

0 commit comments

Comments
 (0)