llvm-config: replace assertions with a helpful error message

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260700
This commit is contained in:
Mehdi Amini 2016-02-12 18:43:10 +00:00
parent abece15858
commit 907313a9cf
1 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,14 @@ static void VisitComponent(const std::string &Name,
const std::string &DirSep) {
// Lookup the component.
AvailableComponent *AC = ComponentMap.lookup(Name);
if (!AC) {
errs() << "Can't find component: '" << Name << "' in the map. Available components are: ";
for (const auto &Component : ComponentMap) {
errs() << "'" << Component.first() << "' ";
}
errs() << "\n";
report_fatal_error("abort");
}
assert(AC && "Invalid component name!");
// Add to the visited table.