Revision: 123567
Author:   bwendlin
Date:     2007-02-07 18:16:06 -0800 (Wed, 07 Feb 2007)

Log Message:
-----------
The "addPassesToEmitFile" method should have the "*Finish" method called 
afterwards.

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-backend.cpp

Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-backend.cpp      2007-02-08 01:49:59 UTC 
(rev 123566)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp      2007-02-08 02:16:06 UTC 
(rev 123567)
@@ -338,14 +338,21 @@
     }
 
     // Normal mode, emit a .s file by running the code generator.
-    if (TheTarget->addPassesToEmitFile(*PM, *AsmOutStream,
-                                       TargetMachine::AssemblyFile,
-                                       /*FAST*/optimize == 0)
-        == FileModel::Error) {
+    switch (TheTarget->addPassesToEmitFile(*PM, *AsmOutStream,
+                                           TargetMachine::AssemblyFile,
+                                           /*FAST*/optimize == 0)) {
+    default:
+    case FileModel::Error:
       cerr << "Error interfacing to target machine!\n";
       exit(1);
+    case FileModel::AsmFile:
+      break;
     }
-    
+
+    if (TheTarget->addPassesToEmitFileFinish(*PM, 0, /*Fast*/optimize == 0)) {
+      cerr << "Error interfacing to target machine!\n";
+      exit(1);
+    }
   }
   
   if (HasPerFunctionPasses) {


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to