]> granicus.if.org Git - clang/commitdiff
Driver: Return 0 from BuildCompilation on -ccc-print-phases,
authorDaniel Dunbar <daniel@zuster.org>
Fri, 13 Mar 2009 17:24:34 +0000 (17:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 13 Mar 2009 17:24:34 +0000 (17:24 +0000)
-ccc-print-options.

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

lib/Driver/Driver.cpp
tools/driver/driver.cpp

index d09aa18d225e9e094ee35a0e6d6c356b4749e63c..fcfa9adca4a0b57b12968554dcd5278f34f78d06 100644 (file)
@@ -152,7 +152,7 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
   // FIXME: This behavior shouldn't be here.
   if (CCCPrintOptions) {
     PrintOptions(*Args);
-    exit(0);
+    return 0;
   }
 
   if (!HandleImmediateArgs(*Args))
@@ -166,12 +166,12 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
   else
     BuildActions(*Args, Actions);
 
-  // FIXME: This behavior shouldn't be here.
   if (CCCPrintActions) {
     PrintActions(*Args, Actions);
-    exit(0);
+    return 0;
   }
-    
+
+  
   assert(0 && "FIXME: Implement");
 
   return new Compilation();
index 645a3ff11a8a2e88bd1808723ab3392d1500536a..fd0cc9cbb8a5907bedfc91d1eddc6e4662e4077e 100644 (file)
@@ -52,6 +52,8 @@ int main(int argc, const char **argv) {
   // If there were errors building the compilation, quit now.
   if (Diags.getNumErrors())
     return 1;
+  if (!C.get())
+    return 0;
 
   return C->Execute();
 }