summaryrefslogtreecommitdiffstats
path: root/llvm/tools/extract/extract.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/extract/extract.cpp')
-rw-r--r--llvm/tools/extract/extract.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/tools/extract/extract.cpp b/llvm/tools/extract/extract.cpp
index c7f942af27e..3f24e387e6e 100644
--- a/llvm/tools/extract/extract.cpp
+++ b/llvm/tools/extract/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;
}
OpenPOWER on IntegriCloud