diff options
author | Anders Waldenborg <anders@0x63.nu> | 2013-10-09 19:02:09 +0000 |
---|---|---|
committer | Anders Waldenborg <anders@0x63.nu> | 2013-10-09 19:02:09 +0000 |
commit | 9360e64e60f600bff98dbff96fabaab536947f86 (patch) | |
tree | cf0b470ea2b966757766107717c4f02073b7a44d /include | |
parent | 5e5d494ce00741858d5a2f8c305bcd0b341988d2 (diff) | |
download | external_llvm-9360e64e60f600bff98dbff96fabaab536947f86.zip external_llvm-9360e64e60f600bff98dbff96fabaab536947f86.tar.gz external_llvm-9360e64e60f600bff98dbff96fabaab536947f86.tar.bz2 |
llvm-c: Make target initializer functions external functions in lib.
Making them proper functions defined in the (shared)lib instead of
static inlines defined in the header files makes it possible to
actually distribute a binary compiled against the shared library
without having to worry about getting undefined symbol errors when
calling e.g LLVMInitializeAllTargetInfos because the shared library on
the other system was compiled with different targets.
Differential Revision: http://llvm-reviews.chandlerc.com/D1714
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm-c/Target.h | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h index 80fc3e5..1d7884f 100644 --- a/include/llvm-c/Target.h +++ b/include/llvm-c/Target.h @@ -71,62 +71,37 @@ typedef struct LLVMStructLayout *LLVMStructLayoutRef; void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ - + /** LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all available targets that LLVM is configured to support. */ -static inline void LLVMInitializeAllTargetInfos(void) { -#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo(); -#include "llvm/Config/Targets.def" -#undef LLVM_TARGET /* Explicit undef to make SWIG happier */ -} +void LLVMInitializeAllTargetInfos(void); /** LLVMInitializeAllTargets - The main program should call this function if it wants to link in all available targets that LLVM is configured to support. */ -static inline void LLVMInitializeAllTargets(void) { -#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target(); -#include "llvm/Config/Targets.def" -#undef LLVM_TARGET /* Explicit undef to make SWIG happier */ -} +void LLVMInitializeAllTargets(void); /** LLVMInitializeAllTargetMCs - The main program should call this function if it wants access to all available target MC that LLVM is configured to support. */ -static inline void LLVMInitializeAllTargetMCs(void) { -#define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC(); -#include "llvm/Config/Targets.def" -#undef LLVM_TARGET /* Explicit undef to make SWIG happier */ -} - +void LLVMInitializeAllTargetMCs(void); + /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmPrinters(void) { -#define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter(); -#include "llvm/Config/AsmPrinters.def" -#undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ -} - +void LLVMInitializeAllAsmPrinters(void); + /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmParsers(void) { -#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser(); -#include "llvm/Config/AsmParsers.def" -#undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ -} - +void LLVMInitializeAllAsmParsers(void); + /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllDisassemblers(void) { -#define LLVM_DISASSEMBLER(TargetName) \ - LLVMInitialize##TargetName##Disassembler(); -#include "llvm/Config/Disassemblers.def" -#undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ -} - +void LLVMInitializeAllDisassemblers(void); + /** LLVMInitializeNativeTarget - The main program should call this function to initialize the native target corresponding to the host. This is useful for JIT applications to ensure that the target gets linked in correctly. */ |