r187888 - Indicate success for simple options when clang called with -cc1.

Rafael Espindola rafael.espindola at gmail.com
Wed Aug 7 05:54:47 PDT 2013


Author: rafael
Date: Wed Aug  7 07:54:47 2013
New Revision: 187888

URL: http://llvm.org/viewvc/llvm-project?rev=187888&view=rev
Log:
Indicate success for simple options when clang called with -cc1.

Patch by David Wiberg.

Added:
    cfe/trunk/test/Frontend/cc1-return-codes.c
Modified:
    cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp

Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=187888&r1=187887&r2=187888&view=diff
==============================================================================
--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)
+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Wed Aug  7 07:54:47 2013
@@ -183,7 +183,7 @@ bool clang::ExecuteCompilerInvocation(Co
     Opts->PrintHelp(llvm::outs(), "clang -cc1",
                     "LLVM 'Clang' Compiler: http://clang.llvm.org",
                     /*Include=*/ driver::options::CC1Option, /*Exclude=*/ 0);
-    return 0;
+    return true;
   }
 
   // Honor -version.
@@ -191,7 +191,7 @@ bool clang::ExecuteCompilerInvocation(Co
   // FIXME: Use a better -version message?
   if (Clang->getFrontendOpts().ShowVersion) {
     llvm::cl::PrintVersionMessage();
-    return 0;
+    return true;
   }
 
   // Load any requested plugins.
@@ -223,7 +223,7 @@ bool clang::ExecuteCompilerInvocation(Co
   // This should happen AFTER plugins have been loaded!
   if (Clang->getAnalyzerOpts()->ShowCheckerHelp) {
     ento::printCheckerHelp(llvm::outs(), Clang->getFrontendOpts().Plugins);
-    return 0;
+    return true;
   }
 #endif
 

Added: cfe/trunk/test/Frontend/cc1-return-codes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/cc1-return-codes.c?rev=187888&view=auto
==============================================================================
--- cfe/trunk/test/Frontend/cc1-return-codes.c (added)
+++ cfe/trunk/test/Frontend/cc1-return-codes.c Wed Aug  7 07:54:47 2013
@@ -0,0 +1,4 @@
+// cc1 immediate arguments (arguments which displays information and exits)
+// shall exit indicating success (return code 0)
+// RUN: %clang -cc1 -help
+// RUN: %clang -cc1 -version





More information about the cfe-commits mailing list