[llvm-commits] [llvm] r103150 - /llvm/trunk/tools/llc/llc.cpp
Chris Lattner
sabre at nondot.org
Wed May 5 17:54:20 PDT 2010
Author: lattner
Date: Wed May 5 19:54:20 2010
New Revision: 103150
URL: http://llvm.org/viewvc/llvm-project?rev=103150&view=rev
Log:
make -filetype=obj default to emitting its output to foo.obj
when on windows instead of foo.o. Patch by Nathan Jeffords!
Modified:
llvm/trunk/tools/llc/llc.cpp
Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=103150&r1=103149&r2=103150&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Wed May 5 19:54:20 2010
@@ -119,7 +119,8 @@
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 @@
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 @@
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;
More information about the llvm-commits
mailing list