diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2018-06-11 09:18:01 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2018-06-11 09:18:01 +0000 |
commit | 64165929092e2c677ca15a130eca045e1e06173b (patch) | |
tree | 6c65ed5dea0629b8b946a3755c51311a2622b380 /llvm/tools/llvm-exegesis/llvm-exegesis.cpp | |
parent | fa5a72865791f17d80ee101d8218e57a690a41fa (diff) | |
download | bcm5719-llvm-64165929092e2c677ca15a130eca045e1e06173b.tar.gz bcm5719-llvm-64165929092e2c677ca15a130eca045e1e06173b.zip |
[llvm-exegesis] Program should succeed if benchmark returns StringError.
Summary: Fix for https://bugs.llvm.org/show_bug.cgi?id=37759.
Reviewers: courbet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D48004
llvm-svn: 334395
Diffstat (limited to 'llvm/tools/llvm-exegesis/llvm-exegesis.cpp')
-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 { |