llvm.org GIT mirror llvm / c4b2271
Add InitializeNativeTargetDisassembler function. Patch by Ojab. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153476 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
10 changed file(s) with 65 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
683683 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
684684 LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
685685 fi
686 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
687 LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
688 fi
686689 AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET,
687690 [LLVM name for the native Target init function, if available])
688691 AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO,
694697 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
695698 AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER,
696699 [LLVM name for the native AsmParser init function, if available])
700 fi
701 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
702 AC_DEFINE_UNQUOTED(LLVM_NATIVE_DISASSEMBLER, $LLVM_NATIVE_DISASSEMBLER,
703 [LLVM name for the native Disassembler init function, if available])
697704 fi
698705 fi
699706 done
339339 if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt)
340340 set(LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser)
341341 endif ()
342
343 # We don't have an disassembler for all architectures yet.
344 if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/CMakeLists.txt)
345 set(LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler)
346 endif ()
342347 endif ()
343348
344349 if( MINGW )
53645364 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
53655365 LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
53665366 fi
5367 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
5368 LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
5369 fi
53675370
53685371 cat >>confdefs.h <<_ACEOF
53695372 #define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET
53885391
53895392 cat >>confdefs.h <<_ACEOF
53905393 #define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER
5394 _ACEOF
5395
5396 fi
5397 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
5398
5399 cat >>confdefs.h <<_ACEOF
5400 #define LLVM_NATIVE_DISASSEMBLER $LLVM_NATIVE_DISASSEMBLER
53915401 _ACEOF
53925402
53935403 fi
1037310383 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1037410384 lt_status=$lt_dlunknown
1037510385 cat > conftest.$ac_ext <
10376 #line 10377 "configure"
10386 #line 10387 "configure"
1037710387 #include "confdefs.h"
1037810388
1037910389 #if HAVE_DLFCN_H
571571 /* LLVM name for the native AsmPrinter init function, if available */
572572 #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
573573
574 /* LLVM name for the native Disassembler init function, if available */
575 #cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
576
574577 /* LLVM name for the native Target init function, if available */
575578 #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
576579
566566 /* LLVM name for the native AsmPrinter init function, if available */
567567 #undef LLVM_NATIVE_ASMPRINTER
568568
569 /* LLVM name for the native Disassembler init function, if available */
570 #undef LLVM_NATIVE_DISASSEMBLER
571
569572 /* LLVM name for the native Target init function, if available */
570573 #undef LLVM_NATIVE_TARGET
571574
6060 /* LLVM name for the native AsmPrinter init function, if available */
6161 #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
6262
63 /* LLVM name for the native Disassembler init function, if available */
64 #cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
65
6366 /* LLVM name for the native Target init function, if available */
6467 #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
6568
6060 /* LLVM name for the native AsmPrinter init function, if available */
6161 #undef LLVM_NATIVE_ASMPRINTER
6262
63 /* LLVM name for the native Disassembler init function, if available */
64 #undef LLVM_NATIVE_DISASSEMBLER
65
6366 /* LLVM name for the native Target init function, if available */
6467 #undef LLVM_NATIVE_TARGET
6568
148148 #endif
149149 }
150150
151 /// InitializeNativeTargetDisassembler - The main program should call
152 /// this function to initialize the native target disassembler.
153 inline bool InitializeNativeTargetDisassembler() {
154 // If we have a native target, initialize the corresponding disassembler.
155 #ifdef LLVM_NATIVE_DISASSEMBLER
156 LLVM_NATIVE_DISASSEMBLER();
157 return false;
158 #else
159 return true;
160 #endif
161 }
162
151163 }
152164
153165 #endif
616616 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
617617 LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
618618 fi
619 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
620 LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
621 fi
619622 AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET,
620623 [LLVM name for the native Target init function, if available])
621624 AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO,
627630 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
628631 AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPARSER, $LLVM_NATIVE_ASMPARSER,
629632 [LLVM name for the native AsmParser init function, if available])
633 fi
634 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
635 AC_DEFINE_UNQUOTED(LLVM_NATIVE_DISASSEMBLER, $LLVM_NATIVE_DISASSEMBLER,
636 [LLVM name for the native Disassembler init function, if available])
630637 fi
631638 fi
632639 done
53055305 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
53065306 LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
53075307 fi
5308 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
5309 LLVM_NATIVE_DISASSEMBLER="LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler"
5310 fi
53085311
53095312 cat >>confdefs.h <<_ACEOF
53105313 #define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET
53295332
53305333 cat >>confdefs.h <<_ACEOF
53315334 #define LLVM_NATIVE_ASMPARSER $LLVM_NATIVE_ASMPARSER
5335 _ACEOF
5336
5337 fi
5338 if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/Makefile ; then
5339
5340 cat >>confdefs.h <<_ACEOF
5341 #define LLVM_NATIVE_DISASSEMBLER $LLVM_NATIVE_DISASSEMBLER
53325342 _ACEOF
53335343
53345344 fi
1028910299 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1029010300 lt_status=$lt_dlunknown
1029110301 cat > conftest.$ac_ext <
10292 #line 10293 "configure"
10302 #line 10303 "configure"
1029310303 #include "confdefs.h"
1029410304
1029510305 #if HAVE_DLFCN_H