Skip to content

Commit e29b081

Browse files
committed
RequirementMachine: Dump conformance access paths
1 parent fb097ae commit e29b081

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/AST/RequirementMachine/GenericSignatureQueries.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,14 @@ RequirementMachine::getConformanceAccessPath(Type type,
517517
return found->second;
518518
}
519519

520-
assert(CurrentConformanceAccessPaths.size() > 0);
520+
if (CurrentConformanceAccessPaths.empty()) {
521+
llvm::errs() << "Failed to find conformance access path for ";
522+
llvm::errs() << type << " " << protocol->getName() << "\n:";
523+
type.dump(llvm::errs());
524+
llvm::errs() << "\n";
525+
dump(llvm::errs());
526+
abort();
527+
}
521528

522529
// The buffer consists of all conformance access paths of length N.
523530
// Swap it out with an empty buffer, and fill it with all paths of

lib/AST/RequirementMachine/RequirementMachine.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ void RequirementMachine::dump(llvm::raw_ostream &out) const {
305305
out << "Requirement machine for " << Sig << "\n";
306306
System.dump(out);
307307
Map.dump(out);
308+
309+
out << "\nConformance access paths:\n";
310+
for (auto pair : ConformanceAccessPaths) {
311+
out << "- " << pair.first.first << " : ";
312+
out << pair.first.second->getName() << " => ";
313+
pair.second.print(out);
314+
out << "\n";
315+
}
308316
}
309317

310318
RequirementMachine::RequirementMachine(RewriteContext &ctx)

0 commit comments

Comments
 (0)