summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-as/llvm-as.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-25 20:54:43 +0000
committerChris Lattner <sabre@nondot.org>2004-06-25 20:54:43 +0000
commit10247b13c0066ab91743e72c9df210f4d7e5f6e7 (patch)
tree1c01f28b5507185d784cc09673d72dd6e593a989 /llvm/tools/llvm-as/llvm-as.cpp
parent4ba8a8d1ef0616c96baee1bbe43fb204187aeb3a (diff)
downloadbcm5719-llvm-10247b13c0066ab91743e72c9df210f4d7e5f6e7.tar.gz
bcm5719-llvm-10247b13c0066ab91743e72c9df210f4d7e5f6e7.zip
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
Diffstat (limited to 'llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r--llvm/tools/llvm-as/llvm-as.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp
index d6d850139b5..9e9290d2ccb 100644
--- a/llvm/tools/llvm-as/llvm-as.cpp
+++ b/llvm/tools/llvm-as/llvm-as.cpp
@@ -73,7 +73,8 @@ int main(int argc, char **argv) {
<< "Use -f command line argument to force output\n";
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
Out = &std::cout;
}
@@ -100,7 +101,8 @@ int main(int argc, char **argv) {
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
// SIGINT
RemoveFileOnSignal(OutputFilename);
OpenPOWER on IntegriCloud