[llvm] r202530 - CommandLine: Exit successfully for -version and -help

Justin Bogner mail at justinbogner.com
Fri Feb 28 11:08:01 PST 2014


Author: bogner
Date: Fri Feb 28 13:08:01 2014
New Revision: 202530

URL: http://llvm.org/viewvc/llvm-project?rev=202530&view=rev
Log:
CommandLine: Exit successfully for -version and -help

Tools that use the CommandLine library currently exit with an error
when invoked with -version or -help. This is unusual and non-standard,
so we'll fix them to exit successfully instead.

I don't expect that anyone relies on the current behaviour, so this
should be a fairly safe change.

Modified:
    llvm/trunk/lib/Support/CommandLine.cpp
    llvm/trunk/test/CodeGen/Generic/print-after.ll

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Fri Feb 28 13:08:01 2014
@@ -1496,7 +1496,7 @@ public:
     MoreHelp->clear();
 
     // Halt the program since help information was printed
-    exit(1);
+    exit(0);
   }
 };
 
@@ -1732,7 +1732,7 @@ public:
 
     if (OverrideVersionPrinter != 0) {
       (*OverrideVersionPrinter)();
-      exit(1);
+      exit(0);
     }
     print();
 
@@ -1746,7 +1746,7 @@ public:
         (*I)();
     }
 
-    exit(1);
+    exit(0);
   }
 };
 } // End anonymous namespace

Modified: llvm/trunk/test/CodeGen/Generic/print-after.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/print-after.ll?rev=202530&r1=202529&r2=202530&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/print-after.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/print-after.ll Fri Feb 28 13:08:01 2014
@@ -1,4 +1,4 @@
-; RUN: not llc --help-hidden 2>&1 | FileCheck %s
+; RUN: llc --help-hidden 2>&1 | FileCheck %s
 
 ; CHECK: -print-after
 ; CHECK-NOT: -print-after-all





More information about the llvm-commits mailing list