[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 25 15:56:01 PDT 2004


Changes in directory llvm/tools/llvm-as:

llvm-as.cpp updated: 1.27 -> 1.28

---
Log message:

Write .bc files to binary ostreams.  This shouldn't change anything on unix,
but allows us to generate valid code on hosts (like windows) that do newline
translation for text files.


---
Diffs of the changes:  (+4 -2)

Index: llvm/tools/llvm-as/llvm-as.cpp
diff -u llvm/tools/llvm-as/llvm-as.cpp:1.27 llvm/tools/llvm-as/llvm-as.cpp:1.28
--- llvm/tools/llvm-as/llvm-as.cpp:1.27	Thu May 27 00:38:45 2004
+++ llvm/tools/llvm-as/llvm-as.cpp	Fri Jun 25 15:54:43 2004
@@ -73,7 +73,8 @@
                     << "Use -f command line argument to force output\n";
           return 1;
         }
-        Out = new std::ofstream(OutputFilename.c_str());
+        Out = new std::ofstream(OutputFilename.c_str(), std::ios_base::out | 
+                                std::ios_base::trunc | std::ios_base::binary);
       } else {                      // Specified stdout
 	Out = &std::cout;       
       }
@@ -100,7 +101,8 @@
           return 1;
         }
 
-	Out = new std::ofstream(OutputFilename.c_str());
+	Out = new std::ofstream(OutputFilename.c_str(), std::ios_base::out | 
+                                std::ios_base::trunc | std::ios_base::binary);
         // Make sure that the Out file gets unlinked from the disk if we get a
         // SIGINT
         RemoveFileOnSignal(OutputFilename);





More information about the llvm-commits mailing list