Skip to content
Snippets Groups Projects
Commit 10247b13 authored by Chris Lattner's avatar Chris Lattner
Browse files

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.

llvm-svn: 14418
parent 4ba8a8d1
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,8 @@ int main(int argc, char **argv) { ...@@ -73,7 +73,8 @@ int main(int argc, char **argv) {
<< "Use -f command line argument to force output\n"; << "Use -f command line argument to force output\n";
return 1; 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 } else { // Specified stdout
Out = &std::cout; Out = &std::cout;
} }
...@@ -100,7 +101,8 @@ int main(int argc, char **argv) { ...@@ -100,7 +101,8 @@ int main(int argc, char **argv) {
return 1; 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 // Make sure that the Out file gets unlinked from the disk if we get a
// SIGINT // SIGINT
RemoveFileOnSignal(OutputFilename); RemoveFileOnSignal(OutputFilename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment