diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-02-12 18:43:10 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-02-12 18:43:10 +0000 |
commit | 907313a9cf3fab2fe348bfebac799c921164b87c (patch) | |
tree | 1b25d7de65fc95878bb9028edb93a657a5403208 /llvm/tools/llvm-config/llvm-config.cpp | |
parent | abece15858a8b6c66574279f60e27c6a1e52bebd (diff) | |
download | bcm5719-llvm-907313a9cf3fab2fe348bfebac799c921164b87c.tar.gz bcm5719-llvm-907313a9cf3fab2fe348bfebac799c921164b87c.zip |
llvm-config: replace assertions with a helpful error message
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260700
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r-- | llvm/tools/llvm-config/llvm-config.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp index a867e1b60d8..e5b121006f5 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp @@ -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. |