summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-07-18 22:21:40 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-07-18 22:21:40 +0000
commit63e14b5a4a08359a0632bb54559a1d7326a72a60 (patch)
treeeb7e4761db4afe39ab2b7580d3ee3132e13e9334
parent1db75a0f7c0fba6b129a32247754f55c15e3a1c8 (diff)
downloadbcm5719-llvm-63e14b5a4a08359a0632bb54559a1d7326a72a60.tar.gz
bcm5719-llvm-63e14b5a4a08359a0632bb54559a1d7326a72a60.zip
Initialize the target architecture based on compiler defines, so if compiled on
x86 or Sparc, LLC will automatically default to that platform, no guessing required. On another platform, it will default to `noarch' and will have to guess which architecture to compile to. llvm-svn: 7207
-rw-r--r--llvm/tools/llc/llc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 4d1bb772edf..71667c34a3c 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -35,7 +35,14 @@ 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"),
0),
- cl::init(noarch));
+#if defined(i386) || defined(__i386__) || defined(__x86__)
+ cl::init(x86)
+#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
+ cl::init(Sparc)
+#else
+ cl::init(noarch)
+#endif
+ );
// GetFileNameRoot - Helper function to get the basename of a filename...
static inline std::string
OpenPOWER on IntegriCloud