[llvm-commits] CVS: llvm/tools/llc/llc.cpp

Misha Brukman brukman at cs.uiuc.edu
Fri Jul 18 17:22:01 PDT 2003


Changes in directory llvm/tools/llc:

llc.cpp updated: 1.78 -> 1.79

---
Log message:

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.


---
Diffs of the changes:

Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.78 llvm/tools/llc/llc.cpp:1.79
--- llvm/tools/llc/llc.cpp:1.78	Mon Jul  7 17:28:42 2003
+++ llvm/tools/llc/llc.cpp	Fri Jul 18 17:21:40 2003
@@ -35,7 +35,14 @@
      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





More information about the llvm-commits mailing list