aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-extract
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2005-01-22 17:36:17 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2005-01-22 17:36:17 +0000
commit5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b (patch)
tree1a699df0388afa1ed3d3acc4e4cd91085adbed10 /tools/llvm-extract
parent695c9bdbd0ad9d540dea68e201cd616afb4320d4 (diff)
downloadexternal_llvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.zip
external_llvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.tar.gz
external_llvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.tar.bz2
Use binary mode for reading/writing bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-extract')
-rw-r--r--tools/llvm-extract/llvm-extract.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index c7f942a..3f24e38 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -63,9 +63,8 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
<< "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;
}