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 {
729
729
};
730
730
731
731
static void checkAddressWalkerCanVisitAllTransitiveUses (SILValue address) {
732
+ SmallVector<SILInstruction *, 8 > badUsers;
732
733
struct Visitor : TransitiveAddressWalker<Visitor> {
734
+ SmallVectorImpl<SILInstruction *> &badUsers;
735
+ Visitor (SmallVectorImpl<SILInstruction *> &badUsers)
736
+ : TransitiveAddressWalker<Visitor>(), badUsers(badUsers) {}
733
737
bool visitUse (Operand *use) { return true ; }
734
- void onError (Operand *use) {}
738
+ void onError (Operand *use) {
739
+ badUsers.push_back (use->getUser ());
740
+ }
735
741
};
736
742
737
- Visitor visitor;
743
+ Visitor visitor (badUsers) ;
738
744
if (std::move (visitor).walk (address) != AddressUseKind::Unknown)
739
745
return ;
740
746
741
747
llvm::errs () << " TransitiveAddressWalker walker failed to know how to visit "
742
748
" 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
+ }
744
756
llvm::report_fatal_error (" invoking standard assertion failure" );
745
757
}
746
758
You can’t perform that action at this time.
0 commit comments