[llvm-commits] CVS: llvm/tools/llc/Makefile llc.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Feb 13 17:20:00 PST 2004
Changes in directory llvm/tools/llc:
Makefile updated: 1.46 -> 1.47
llc.cpp updated: 1.89 -> 1.90
---
Log message:
Add support for -march=c
---
Diffs of the changes: (+14 -7)
Index: llvm/tools/llc/Makefile
diff -u llvm/tools/llc/Makefile:1.46 llvm/tools/llc/Makefile:1.47
--- llvm/tools/llc/Makefile:1.46 Sat Feb 7 23:49:29 2004
+++ llvm/tools/llc/Makefile Fri Feb 13 17:19:09 2004
@@ -8,7 +8,8 @@
##===----------------------------------------------------------------------===##
LEVEL = ../..
TOOLNAME = llc
-USEDLIBS = sparc \
+USEDLIBS = cwriter \
+ sparc \
x86 \
powerpc \
selectiondag \
@@ -18,6 +19,7 @@
codegen \
target.a \
livevar \
+ ipa.a \
transforms.a \
scalaropts.a \
analysis.a \
Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.89 llvm/tools/llc/llc.cpp:1.90
--- llvm/tools/llc/llc.cpp:1.89 Mon Feb 2 13:06:12 2004
+++ llvm/tools/llc/llc.cpp Fri Feb 13 17:19:09 2004
@@ -37,13 +37,14 @@
static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
-enum ArchName { noarch, x86, Sparc, PowerPC };
+enum ArchName { noarch, X86, Sparc, PowerPC, CBackend };
static cl::opt<ArchName>
Arch("march", cl::desc("Architecture to generate assembly for:"), cl::Prefix,
- cl::values(clEnumVal(x86, " IA-32 (Pentium and above)"),
- clEnumValN(Sparc, "sparc", " SPARC V9"),
- clEnumValN(PowerPC, "powerpc", " PowerPC"),
+ cl::values(clEnumValN(X86, "x86", " IA-32 (Pentium and above)"),
+ clEnumValN(Sparc, "sparc", " SPARC V9"),
+ clEnumValN(PowerPC, "powerpc", " PowerPC"),
+ clEnumValN(CBackend, "c", " C backend"),
0),
cl::init(noarch));
@@ -82,7 +83,10 @@
TargetMachine* (*TargetMachineAllocator)(const Module&,
IntrinsicLowering *) = 0;
switch (Arch) {
- case x86:
+ case CBackend:
+ TargetMachineAllocator = allocateCTargetMachine;
+ break;
+ case X86:
TargetMachineAllocator = allocateX86TargetMachine;
break;
case Sparc:
@@ -116,7 +120,8 @@
TargetMachineAllocator = allocatePowerPCTargetMachine;
#else
std::cerr << argv[0] << ": module does not specify a target to use. "
- << "You must use the -march option.\n";
+ << "You must use the -march option. If no native target is "
+ << "available, use -march=c to emit C code.\n";
return 1;
#endif
}
More information about the llvm-commits
mailing list