[llvm-commits] CVS: llvm/tools/extract/extract.cpp
Jeff Cohen
jeffc at jolt-lang.org
Sat Jan 22 09:36:31 PST 2005
Changes in directory llvm/tools/extract:
extract.cpp updated: 1.26 -> 1.27
---
Log message:
Use binary mode for reading/writing bytecode files
---
Diffs of the changes: (+6 -4)
extract.cpp | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: llvm/tools/extract/extract.cpp
diff -u llvm/tools/extract/extract.cpp:1.26 llvm/tools/extract/extract.cpp:1.27
--- llvm/tools/extract/extract.cpp:1.26 Wed Dec 29 23:36:07 2004
+++ llvm/tools/extract/extract.cpp Sat Jan 22 11:36:16 2005
@@ -63,9 +63,8 @@
return 1;
}
- // In addition to deleting all other functions, we also want to spiff it up a
- // little bit. Do this now.
- //
+ // In addition to deleting all other functions, we also want to spiff it
+ // up a little bit. Do this now.
PassManager Passes;
Passes.add(new TargetData("extract", M.get())); // Use correct TargetData
// Either isolate the function or delete it from the Module
@@ -84,8 +83,11 @@
<< "Use -f command line argument to force output\n";
return 1;
}
- Out = new std::ofstream(OutputFilename.c_str());
+ std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
+ std::ios::binary;
+ Out = new std::ofstream(OutputFilename.c_str(), io_mode);
} else { // Specified stdout
+ // FIXME: cout is not binary!
Out = &std::cout;
}
More information about the llvm-commits
mailing list