diff options
-rw-r--r-- | llvm/tools/llvm-exegesis/llvm-exegesis.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp index bc01d567df1..4a3fe354b67 100644 --- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -200,7 +200,7 @@ static void analysisMain() { llvm::errs() << "unknown target '" << Points[0].LLVMTriple << "'\n"; return; } - const auto Clustering = llvm::cantFail(InstructionBenchmarkClustering::create( + const auto Clustering = ExitOnErr(InstructionBenchmarkClustering::create( Points, AnalysisNumPoints, AnalysisEpsilon)); const Analysis Analyzer(*TheTarget, Clustering); @@ -217,6 +217,12 @@ static void analysisMain() { int main(int Argc, char **Argv) { llvm::cl::ParseCommandLineOptions(Argc, Argv, ""); + exegesis::ExitOnErr.setExitCodeMapper([](const llvm::Error &Err) { + if (Err.isA<llvm::StringError>()) + return EXIT_SUCCESS; + return EXIT_FAILURE; + }); + if (BenchmarkMode == BenchmarkModeE::Analysis) { exegesis::analysisMain(); } else { |