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

Jeff Cohen jeffc at jolt-lang.org
Sat Jan 22 09:36:31 PST 2005



Changes in directory llvm/tools/llvm-ld:

llvm-ld.cpp updated: 1.20 -> 1.21
---
Log message:

Use binary mode for reading/writing bytecode files

---
Diffs of the changes:  (+3 -1)

 llvm-ld.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/tools/llvm-ld/llvm-ld.cpp
diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.20 llvm/tools/llvm-ld/llvm-ld.cpp:1.21
--- llvm/tools/llvm-ld/llvm-ld.cpp:1.20	Wed Dec 29 23:36:07 2004
+++ llvm/tools/llvm-ld/llvm-ld.cpp	Sat Jan 22 11:36:17 2005
@@ -186,7 +186,9 @@
 void GenerateBytecode(Module* M, const std::string& FileName) {
 
   // Create the output file.
-  std::ofstream Out(FileName.c_str());
+  std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
+                               std::ios::binary;
+  std::ofstream Out(FileName.c_str(), io_mode);
   if (!Out.good()) {
     PrintAndReturn("error opening '" + FileName + "' for writing!");
     return;






More information about the llvm-commits mailing list