diff options
author | Chris Lattner <sabre@nondot.org> | 2004-06-25 20:54:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-06-25 20:54:43 +0000 |
commit | a8e750f2b04851e310544e669d2860abd1404546 (patch) | |
tree | acd492bc44ff356db6350a1df2dbaf8310e049d3 /tools/llvm-as/llvm-as.cpp | |
parent | 036de03128f6c512233b64de17736c1be058f024 (diff) | |
download | external_llvm-a8e750f2b04851e310544e669d2860abd1404546.zip external_llvm-a8e750f2b04851e310544e669d2860abd1404546.tar.gz external_llvm-a8e750f2b04851e310544e669d2860abd1404546.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-as/llvm-as.cpp')
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index d6d8501..9e9290d 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/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); |