diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-07-18 22:21:40 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-07-18 22:21:40 +0000 |
commit | fcf2be75ec61c6ae3da53d0e4e9f53b4d754dc9b (patch) | |
tree | 2f990a7784dcd90e4cc7961742bc47eb6d2fdf97 /tools | |
parent | a235e14eaf7997acf7ba8f7088bc77428d52ff1e (diff) | |
download | external_llvm-fcf2be75ec61c6ae3da53d0e4e9f53b4d754dc9b.zip external_llvm-fcf2be75ec61c6ae3da53d0e4e9f53b4d754dc9b.tar.gz external_llvm-fcf2be75ec61c6ae3da53d0e4e9f53b4d754dc9b.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llc/llc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 4d1bb77..71667c3 100644 --- a/tools/llc/llc.cpp +++ b/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 |