diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-06 00:54:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-06 00:54:20 +0000 |
commit | 5758d4ce4603bd2c0b97c87e6e516bf2afd78a85 (patch) | |
tree | 289f19740bbe6e05145985d4acfe1e42b3dc974e /tools | |
parent | 75395847817b88798f9d8cdfb7bc99388167d291 (diff) | |
download | llvm-5758d4ce4603bd2c0b97c87e6e516bf2afd78a85.tar.gz llvm-5758d4ce4603bd2c0b97c87e6e516bf2afd78a85.tar.bz2 llvm-5758d4ce4603bd2c0b97c87e6e516bf2afd78a85.tar.xz |
make -filetype=obj default to emitting its output to foo.obj
when on windows instead of foo.o. Patch by Nathan Jeffords!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llc/llc.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 378cc63201..82cea94645 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -119,7 +119,8 @@ GetFileNameRoot(const std::string &InputFilename) { return outputFilename; } -static formatted_raw_ostream *GetOutputStream(const char *TargetName, +static formatted_raw_ostream *GetOutputStream(const char *TargetName, + Triple::OSType OS, const char *ProgName) { if (OutputFilename != "") { if (OutputFilename == "-") @@ -166,7 +167,10 @@ static formatted_raw_ostream *GetOutputStream(const char *TargetName, OutputFilename += ".s"; break; case TargetMachine::CGFT_ObjectFile: - OutputFilename += ".o"; + if (OS == Triple::Win32) + OutputFilename += ".obj"; + else + OutputFilename += ".o"; Binary = true; break; case TargetMachine::CGFT_Null: @@ -284,7 +288,8 @@ int main(int argc, char **argv) { TargetMachine &Target = *target.get(); // Figure out where we are going to send the output... - formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(), argv[0]); + formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(), + TheTriple.getOS(), argv[0]); if (Out == 0) return 1; CodeGenOpt::Level OLvl = CodeGenOpt::Default; |