OSDN Git Service

[llc] Remove exit-on-error flag (PR27759)
authorDiana Picus <diana.picus@linaro.org>
Thu, 23 Jun 2016 09:49:56 +0000 (09:49 +0000)
committerDiana Picus <diana.picus@linaro.org>
Thu, 23 Jun 2016 09:49:56 +0000 (09:49 +0000)
This flag was introduced in r269655 with the new diagnostic handler for llc. Its
purpose was to keep the old behavior for some of the tests that didn't recover
well after an error. Those tests have been fixed, so now it's safe to remove the
flag entirely.

Fixes PR27759.

Differential Revision: http://reviews.llvm.org/D21368

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273554 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index 6d24204..3fbf60b 100644 (file)
@@ -113,11 +113,6 @@ static cl::opt<bool> DiscardValueNames(
     cl::desc("Discard names from Value (other than GlobalValue)."),
     cl::init(false), cl::Hidden);
 
-static cl::opt<bool> ExitOnError(
-    "exit-on-error",
-    cl::desc("Exit as soon as an error is encountered."),
-    cl::init(false), cl::Hidden);
-
 namespace {
 static ManagedStatic<std::vector<std::string>> RunPassNames;
 
@@ -257,8 +252,7 @@ int main(int argc, char **argv) {
 
   // Set a diagnostic handler that doesn't exit on the first error
   bool HasError = false;
-  if (!ExitOnError)
-    Context.setDiagnosticHandler(DiagnosticHandler, &HasError);
+  Context.setDiagnosticHandler(DiagnosticHandler, &HasError);
 
   // Compile the module TimeCompilations times to give better compile time
   // metrics.
@@ -486,11 +480,9 @@ static int compileModule(char **argv, LLVMContext &Context) {
 
     PM.run(*M);
 
-    if (!ExitOnError) {
-      auto HasError = *static_cast<bool *>(Context.getDiagnosticContext());
-      if (HasError)
-        return 1;
-    }
+    auto HasError = *static_cast<bool *>(Context.getDiagnosticContext());
+    if (HasError)
+      return 1;
 
     // Compare the two outputs and make sure they're the same
     if (CompileTwice) {