summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-13 23:19:09 +0000
committerChris Lattner <sabre@nondot.org>2004-02-13 23:19:09 +0000
commit666d20a3018efac8b1bc2f0af7d78ad36f8049e9 (patch)
tree2c79ba9498a395866d6be7f4869593eaf2f38c60
parentf31182a531770ed1d647c822de68b953663102ff (diff)
Add support for -march=c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11410 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/llc/Makefile4
-rw-r--r--tools/llc/llc.cpp17
2 files changed, 14 insertions, 7 deletions
diff --git a/tools/llc/Makefile b/tools/llc/Makefile
index 7a54f1f8180..c018032f911 100644
--- a/tools/llc/Makefile
+++ b/tools/llc/Makefile
@@ -8,7 +8,8 @@
##===----------------------------------------------------------------------===##
LEVEL = ../..
TOOLNAME = llc
-USEDLIBS = sparc \
+USEDLIBS = cwriter \
+ sparc \
x86 \
powerpc \
selectiondag \
@@ -18,6 +19,7 @@ USEDLIBS = sparc \
codegen \
target.a \
livevar \
+ ipa.a \
transforms.a \
scalaropts.a \
analysis.a \
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 2ce1e542765..24a3a35fc82 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -37,13 +37,14 @@ OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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
}