1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Add InitializeNativeTargetDisassembler function.

Patch by Ojab.

llvm-svn: 153476
This commit is contained in:
Eric Christopher 2012-03-26 21:56:56 +00:00
parent e13ce38b53
commit 1ba37ca43c
10 changed files with 65 additions and 2 deletions

View File

@ -684,6 +684,9 @@ for a_target in $TARGETS_TO_BUILD; do
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser" LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
fi
AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET, AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET,
[LLVM name for the native Target init function, if available]) [LLVM name for the native Target init function, if available])
AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO, AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO,
@ -696,6 +699,10 @@ for a_target in $TARGETS_TO_BUILD; do
AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER, AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER,
[LLVM name for the native AsmParser init function, if available]) [LLVM name for the native AsmParser init function, if available])
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
AC_DEFINE_UNQUOTED(LLVM_NATIVE_DISASSEMBLER, $LLVM_NATIVE_DISASSEMBLER,
[LLVM name for the native Disassembler init function, if available])
fi
fi fi
done done

View File

@ -340,6 +340,11 @@ else ()
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt) if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt)
set(LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser) set(LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser)
endif () endif ()
# We don't have an disassembler for all architectures yet.
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/CMakeLists.txt)
set(LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler)
endif ()
endif () endif ()
if( MINGW ) if( MINGW )

12
configure vendored
View File

@ -5365,6 +5365,9 @@ _ACEOF
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser" LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
fi
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET #define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET
@ -5389,6 +5392,13 @@ _ACEOF
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER #define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER
_ACEOF
fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_DISASSEMBLER $LLVM_NATIVE_DISASSEMBLER
_ACEOF _ACEOF
fi fi
@ -10374,7 +10384,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10377 "configure" #line 10387 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H

View File

@ -572,6 +572,9 @@
/* LLVM name for the native AsmPrinter init function, if available */ /* LLVM name for the native AsmPrinter init function, if available */
#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
/* LLVM name for the native Disassembler init function, if available */
#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
/* LLVM name for the native Target init function, if available */ /* LLVM name for the native Target init function, if available */
#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target

View File

@ -567,6 +567,9 @@
/* LLVM name for the native AsmPrinter init function, if available */ /* LLVM name for the native AsmPrinter init function, if available */
#undef LLVM_NATIVE_ASMPRINTER #undef LLVM_NATIVE_ASMPRINTER
/* LLVM name for the native Disassembler init function, if available */
#undef LLVM_NATIVE_DISASSEMBLER
/* LLVM name for the native Target init function, if available */ /* LLVM name for the native Target init function, if available */
#undef LLVM_NATIVE_TARGET #undef LLVM_NATIVE_TARGET

View File

@ -61,6 +61,9 @@
/* LLVM name for the native AsmPrinter init function, if available */ /* LLVM name for the native AsmPrinter init function, if available */
#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
/* LLVM name for the native Disassembler init function, if available */
#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
/* LLVM name for the native Target init function, if available */ /* LLVM name for the native Target init function, if available */
#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target

View File

@ -61,6 +61,9 @@
/* LLVM name for the native AsmPrinter init function, if available */ /* LLVM name for the native AsmPrinter init function, if available */
#undef LLVM_NATIVE_ASMPRINTER #undef LLVM_NATIVE_ASMPRINTER
/* LLVM name for the native Disassembler init function, if available */
#undef LLVM_NATIVE_DISASSEMBLER
/* LLVM name for the native Target init function, if available */ /* LLVM name for the native Target init function, if available */
#undef LLVM_NATIVE_TARGET #undef LLVM_NATIVE_TARGET

View File

@ -149,6 +149,18 @@ namespace llvm {
#endif #endif
} }
/// InitializeNativeTargetDisassembler - The main program should call
/// this function to initialize the native target disassembler.
inline bool InitializeNativeTargetDisassembler() {
// If we have a native target, initialize the corresponding disassembler.
#ifdef LLVM_NATIVE_DISASSEMBLER
LLVM_NATIVE_DISASSEMBLER();
return false;
#else
return true;
#endif
}
} }
#endif #endif

View File

@ -617,6 +617,9 @@ for a_target in $TARGETS_TO_BUILD; do
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser" LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
fi
AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET, AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET,
[LLVM name for the native Target init function, if available]) [LLVM name for the native Target init function, if available])
AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO, AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO,
@ -629,6 +632,10 @@ for a_target in $TARGETS_TO_BUILD; do
AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER, AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER,
[LLVM name for the native AsmParser init function, if available]) [LLVM name for the native AsmParser init function, if available])
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
AC_DEFINE_UNQUOTED(LLVM_NATIVE_DISASSEMBLER, $LLVM_NATIVE_DISASSEMBLER,
[LLVM name for the native Disassembler init function, if available])
fi
fi fi
done done

View File

@ -5306,6 +5306,9 @@ _ACEOF
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser" LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
fi fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
fi
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET #define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET
@ -5330,6 +5333,13 @@ _ACEOF
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER #define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER
_ACEOF
fi
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_DISASSEMBLER $LLVM_NATIVE_DISASSEMBLER
_ACEOF _ACEOF
fi fi
@ -10290,7 +10300,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 10293 "configure" #line 10303 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H