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);
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 {