[llvm-commits] [llvm] r110109 - in /llvm/trunk: 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

Xerxes RĂ„nby xerxes at zafena.se
Mon Aug 9 05:49:00 PDT 2010


Hi this change have reinstalled llvm pr4427
http://llvm.org/bugs/show_bug.cgi?id=4427

for example when compiling a project that uses llvm JIT on X86 then if
X86 are defined this bug hits when calling

InitializeNativeTargetAsmPrinter()

the macro expands into
LLVMInitializeAsmPrinter() that dont exist.
instead of
LLVMInitializeX86AsmPrinter() that do exist.

Cheers
Xerxes


On 2010-08-03 16:26, Daniel Dunbar wrote:
> Author: ddunbar
> Date: Tue Aug  3 09:26:17 2010
> New Revision: 110109
>
> URL: http://llvm.org/viewvc/llvm-project?rev=110109&view=rev
> Log:
> build: Add LLVM_NATIVE_ARCHNAME, which has the sensible value, without "Target"
> appended.
>
> Modified:
>     llvm/trunk/autoconf/configure.ac
>     llvm/trunk/cmake/config-ix.cmake
>     llvm/trunk/configure
>     llvm/trunk/include/llvm/Config/config.h.cmake
>     llvm/trunk/include/llvm/Config/config.h.in
>     llvm/trunk/include/llvm/Target/TargetSelect.h
>
> Modified: llvm/trunk/autoconf/configure.ac
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/autoconf/configure.ac (original)
> +++ llvm/trunk/autoconf/configure.ac Tue Aug  3 09:26:17 2010
> @@ -599,6 +599,8 @@
>  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
>
> Modified: llvm/trunk/cmake/config-ix.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/config-ix.cmake (original)
> +++ llvm/trunk/cmake/config-ix.cmake Tue Aug  3 09:26:17 2010
> @@ -207,6 +207,7 @@
>  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 
>
> Modified: llvm/trunk/configure
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/configure (original)
> +++ llvm/trunk/configure Tue Aug  3 09:26:17 2010
> @@ -5018,6 +5018,11 @@
>      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 @@
>    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
>
> Modified: llvm/trunk/include/llvm/Config/config.h.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Config/config.h.cmake (original)
> +++ llvm/trunk/include/llvm/Config/config.h.cmake Tue Aug  3 09:26:17 2010
> @@ -625,3 +625,6 @@
>  
>  /* Native LLVM architecture */
>  #cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}Target
> +
> +/* Native LLVM architecture, short name */
> +#cmakedefine LLVM_NATIVE_ARCHNAME ${LLVM_NATIVE_ARCH}
>
> Modified: llvm/trunk/include/llvm/Config/config.h.in
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Config/config.h.in (original)
> +++ llvm/trunk/include/llvm/Config/config.h.in Tue Aug  3 09:26:17 2010
> @@ -500,6 +500,9 @@
>  /* 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
>  
>
> Modified: llvm/trunk/include/llvm/Target/TargetSelect.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=110109&r1=110108&r2=110109&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/TargetSelect.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetSelect.h Tue Aug  3 09:26:17 2010
> @@ -30,13 +30,6 @@
>  #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 @@
>    /// 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 @@
>  #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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>   




More information about the llvm-commits mailing list