Skip to content

Commit 54c83ea

Browse files
committed
RequirementMachine: Make some low-cost assertions unconditional
1 parent e717330 commit 54c83ea

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

lib/AST/RequirementMachine/GenericSignatureQueries.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ RequirementMachine::getLongestValidPrefix(const MutableTerm &term) const {
239239
case Symbol::Kind::Superclass:
240240
case Symbol::Kind::ConcreteType:
241241
case Symbol::Kind::ConcreteConformance:
242-
llvm_unreachable("Property symbol cannot appear in a type term");
242+
llvm::errs() <<"Invalid symbol in a type term: " << term << "\n";
243+
abort();
243244
}
244245

245246
// This symbol is valid, add it to the longest prefix.

lib/AST/RequirementMachine/InterfaceType.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ getTypeForSymbolRange(const Symbol *begin, const Symbol *end, Type root,
311311
case Symbol::Kind::Superclass:
312312
case Symbol::Kind::ConcreteType:
313313
case Symbol::Kind::ConcreteConformance:
314-
llvm_unreachable("Term has invalid root symbol");
314+
llvm::errs() << "Invalid root symbol: " << MutableTerm(begin, end) << "\n";
315+
abort();
315316
}
316317
}
317318

lib/AST/RequirementMachine/MinimalConformances.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ static const ProtocolDecl *getParentConformanceForTerm(Term lhs) {
365365
break;
366366
}
367367

368-
llvm_unreachable("Bad symbol kind");
368+
llvm::errs() << "Bad symbol in " << lhs << "\n";
369+
abort();
369370
}
370371

371372
/// Collect conformance rules and parent paths, and record an initial

lib/AST/RequirementMachine/Symbol.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ Symbol Symbol::withConcreteSubstitutions(
596596
break;
597597
}
598598

599-
llvm_unreachable("Bad symbol kind");
599+
llvm::errs() << "Bad symbol kind: " << *this << "\n";
600+
abort();
600601
}
601602

602603
/// For a superclass or concrete type symbol

0 commit comments

Comments
 (0)