Only output code if file open is successful
authorChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 17:07:22 +0000 (17:07 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 17:07:22 +0000 (17:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@890 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llc/llc.cpp

index 358f95b43a89f9031bb1082c8fd767a75f6aa412..76364aabc23ede95caf550d0df2c29b7fbf0b2fc 100644 (file)
@@ -86,8 +86,6 @@ public:
 
 
   virtual bool doPassFinalization(Module *M) {
-    // TODO: This should be performed as a moduleCleanup function, but we don't
-    // have one yet!
     Target.emitAssembly(M, *Out);
 
     if (DeleteStream) delete Out;
@@ -147,11 +145,11 @@ int main(int argc, char **argv) {
              << "! SKIPPING OUTPUT OF TRACE CODE\n";
         delete os;
         retCode = 1;
+      } else {
+        Passes.push_back(new PrintModulePass("", os,
+                                             /*deleteStream*/ true,
+                                             /*printAsBytecode*/ ! DebugTrace));
       }
-      
-      Passes.push_back(new PrintModulePass("", os,
-                                           /*deleteStream*/ true,
-                                           /*printAsBytecode*/ ! DebugTrace));
     }
   
   // If LLVM dumping after transformations is requested, add it to the pipeline