aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-13 05:01:07 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-13 05:01:07 +0000
commit0d9eb9b4917340acbfc831890655b8e9724959f6 (patch)
tree874f6b97b8075e6ab9ab5713e91dcacff7140c7b /tools
parent241085aa3875edd7eaddd235dd9f535e967aaed4 (diff)
downloadexternal_llvm-0d9eb9b4917340acbfc831890655b8e9724959f6.zip
external_llvm-0d9eb9b4917340acbfc831890655b8e9724959f6.tar.gz
external_llvm-0d9eb9b4917340acbfc831890655b8e9724959f6.tar.bz2
Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llc/llc.cpp7
-rw-r--r--tools/lto/LTOCodeGenerator.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index f185490..bd915ae 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -125,7 +125,7 @@ static raw_ostream *GetOutputStream(const char *ProgName) {
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
std::string error;
- raw_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), error);
+ raw_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), true, error);
if (!error.empty()) {
std::cerr << error << '\n';
delete Out;
@@ -142,6 +142,7 @@ static raw_ostream *GetOutputStream(const char *ProgName) {
OutputFilename = GetFileNameRoot(InputFilename);
+ bool Binary = false;
switch (FileType) {
case TargetMachine::AssemblyFile:
if (MArch->Name[0] == 'c') {
@@ -156,9 +157,11 @@ static raw_ostream *GetOutputStream(const char *ProgName) {
break;
case TargetMachine::ObjectFile:
OutputFilename += ".o";
+ Binary = true;
break;
case TargetMachine::DynamicLibrary:
OutputFilename += LTDL_SHLIB_EXT;
+ Binary = true;
break;
}
@@ -175,7 +178,7 @@ static raw_ostream *GetOutputStream(const char *ProgName) {
sys::RemoveFileOnSignal(sys::Path(OutputFilename));
std::string error;
- raw_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), error);
+ raw_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), Binary, error);
if (!error.empty()) {
std::cerr << error << '\n';
delete Out;
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 0474a88..e0e1f52 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -165,7 +165,7 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
// generate assembly code
bool genResult = false;
{
- raw_fd_ostream asmFile(uniqueAsmPath.c_str(), errMsg);
+ raw_fd_ostream asmFile(uniqueAsmPath.c_str(), false, errMsg);
if (!errMsg.empty())
return NULL;
genResult = this->generateAssemblyCode(asmFile, errMsg);