build: Add LLVM_NATIVE_ARCHNAME, which has the sensible value, without "Target"
authorDaniel Dunbar <daniel@zuster.org>
Tue, 3 Aug 2010 14:26:17 +0000 (14:26 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 3 Aug 2010 14:26:17 +0000 (14:26 +0000)
appended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110109 91177308-0d34-0410-b5e6-96231b3b80d8

autoconf/configure.ac
cmake/config-ix.cmake
configure
include/llvm/Config/config.h.cmake
include/llvm/Config/config.h.in
include/llvm/Target/TargetSelect.h

index 0924a777b4c1e4c856016a04e2f2b68c715e977e..18c9669cc93faccb0f4c86cefde45dd86d88b14d 100644 (file)
@@ -599,6 +599,8 @@ AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
 for a_target in $TARGETS_TO_BUILD; do
   if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
     LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"
+    AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCHNAME,$LLVM_NATIVE_ARCH,
+      [Short LLVM architecture name for the native architecture, if available])
     AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCHTARGET,
       [LLVM architecture name for the native architecture, if available])
   fi
index d9450d925859331dbba52d2eb2d1fe06a3241dc9..e3e5e8d28faab27d657c83c630e6c3bffadea635 100755 (executable)
@@ -207,6 +207,7 @@ else ()
 endif ()
   
 if (LLVM_NATIVE_ARCH)
+  set(LLVM_NATIVE_ARCHNAME ${LLVM_NATIVE_ARCH})
   list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
   if (NATIVE_ARCH_IDX EQUAL -1)
     message(STATUS 
index 98a40c4338e0dc2870580d81d351864a4890c90d..dd5015505ca9defb984af7353c21a5b1977e43ba 100755 (executable)
--- a/configure
+++ b/configure
@@ -5017,6 +5017,11 @@ for a_target in $TARGETS_TO_BUILD; do
   if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
     LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"
 
+cat >>confdefs.h <<_ACEOF
+#define LLVM_NATIVE_ARCHNAME $LLVM_NATIVE_ARCH
+_ACEOF
+
+
 cat >>confdefs.h <<_ACEOF
 #define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCHTARGET
 _ACEOF
@@ -11391,7 +11396,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11394 "configure"
+#line 11399 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index e7594babaa6bd7bb5a1a8ed960b1e151627e69df..5468316f9c96c012066827295059d92d0dcd4f51 100644 (file)
 
 /* Native LLVM architecture */
 #cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}Target
+
+/* Native LLVM architecture, short name */
+#cmakedefine LLVM_NATIVE_ARCHNAME ${LLVM_NATIVE_ARCH}
index d76db860e3896caee7b93f5a598ebd2725f5dfd3..9a10f7f06c296018c6619cf7d412b1ce92f4126f 100644 (file)
 /* LLVM architecture name for the native architecture, if available */
 #undef LLVM_NATIVE_ARCH
 
+/* Short LLVM architecture name for the native architecture, if available */
+#undef LLVM_NATIVE_ARCHNAME
+
 /* Define if this is Unixish platform */
 #undef LLVM_ON_UNIX
 
index fc3244acd8ee065ed0b87bf5527dff44c8beb712..3ade00dc8d49ebac3e45900a07a685f2b693365f 100644 (file)
@@ -30,13 +30,6 @@ extern "C" {
 #define LLVM_ASM_PRINTER(TargetName) void LLVMInitialize##TargetName##AsmPrinter();
 #include "llvm/Config/AsmPrinters.def"
 
-  // FIXME: Workaround for unfortunate definition of LLVM_NATIVE_ARCH.
-#define LLVM_ASM_PRINTER(TargetName) \
-  static inline void LLVMInitialize##TargetName##TargetAsmPrinter() { \
-    LLVMInitialize##TargetName##AsmPrinter(); \
-  }
-#include "llvm/Config/AsmPrinters.def"
-
   // Declare all of the available assembly parser initialization functions.
 #define LLVM_ASM_PARSER(TargetName) void LLVMInitialize##TargetName##AsmParser();
 #include "llvm/Config/AsmParsers.def"
@@ -107,7 +100,7 @@ namespace llvm {
   /// It is legal for a client to make multiple calls to this function.
   inline bool InitializeNativeTarget() {
   // If we have a native target, initialize it to ensure it is linked in.
-#ifdef LLVM_NATIVE_ARCH
+#ifdef LLVM_NATIVE_ARCHNAME
 #define DoInit2(TARG) \
     LLVMInitialize ## TARG ## Info ();          \
     LLVMInitialize ## TARG ()
@@ -129,7 +122,7 @@ namespace llvm {
 #define DoInit2(TARG) \
     LLVMInitialize ## TARG ## AsmPrinter ();
 #define DoInit(T) DoInit2(T)
-    DoInit(LLVM_NATIVE_ARCH);
+    DoInit(LLVM_NATIVE_ARCHNAME);
     return false;
 #undef DoInit
 #undef DoInit2