File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -729,18 +729,30 @@ struct ImmutableAddressUseVerifier {
729729};
730730
731731static void checkAddressWalkerCanVisitAllTransitiveUses (SILValue address) {
732+ SmallVector<SILInstruction *, 8 > badUsers;
732733 struct Visitor : TransitiveAddressWalker<Visitor> {
734+ SmallVectorImpl<SILInstruction *> &badUsers;
735+ Visitor (SmallVectorImpl<SILInstruction *> &badUsers)
736+ : TransitiveAddressWalker<Visitor>(), badUsers(badUsers) {}
733737 bool visitUse (Operand *use) { return true ; }
734- void onError (Operand *use) {}
738+ void onError (Operand *use) {
739+ badUsers.push_back (use->getUser ());
740+ }
735741 };
736742
737- Visitor visitor;
743+ Visitor visitor (badUsers) ;
738744 if (std::move (visitor).walk (address) != AddressUseKind::Unknown)
739745 return ;
740746
741747 llvm::errs () << " TransitiveAddressWalker walker failed to know how to visit "
742748 " a user when visiting: "
743- << *address << ' \n ' ;
749+ << *address;
750+ if (badUsers.size ()) {
751+ llvm::errs () << " Bad Users:\n " ;
752+ for (auto *user : badUsers) {
753+ llvm::errs () << " " << *user;
754+ }
755+ }
744756 llvm::report_fatal_error (" invoking standard assertion failure" );
745757}
746758
You can’t perform that action at this time.
0 commit comments