Fix some error messages; Make LLVMC pass through the exit code of a failed tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50971 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc2/llvmc.cpp b/tools/llvmc2/llvmc.cpp
index 4eeb627..a749274 100644
--- a/tools/llvmc2/llvmc.cpp
+++ b/tools/llvmc2/llvmc.cpp
@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#include "CompilationGraph.h"
+#include "Error.h"
#include "Tool.h"
#include "llvm/System/Path.h"
@@ -92,6 +93,9 @@
return BuildTargets(graph);
}
+ catch(llvmc::error_code& ec) {
+ return ec.code();
+ }
catch(const std::exception& ex) {
std::cerr << ex.what() << '\n';
}