summaryrefslogtreecommitdiff
path: root/include/llvm-c
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-10-09 23:15:49 +0000
committerRui Ueyama <ruiu@google.com>2013-10-09 23:15:49 +0000
commit6bba6bb12f020206baf242ca6b76e1609cdf0d4b (patch)
tree4c8e413e22a39e100c11a2fc736902c3a0a13ae9 /include/llvm-c
parentb4d9c11f6c7e0a38e750f946d5cea3ffa5ae8f61 (diff)
downloadllvm-6bba6bb12f020206baf242ca6b76e1609cdf0d4b.tar.gz
llvm-6bba6bb12f020206baf242ca6b76e1609cdf0d4b.tar.bz2
llvm-6bba6bb12f020206baf242ca6b76e1609cdf0d4b.tar.xz
Revert "llvm-c: Make target initializer functions external functions in lib."
This reverts commit r192316. The original change introduced circular dependencies between libTarget and backends. That would broke a build unless link everything into one big binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c')
-rw-r--r--include/llvm-c/Target.h47
1 files changed, 36 insertions, 11 deletions
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h
index 1d7884f142..80fc3e5ad7 100644
--- a/include/llvm-c/Target.h
+++ b/include/llvm-c/Target.h
@@ -71,37 +71,62 @@ 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. */
-void LLVMInitializeAllTargetInfos(void);
+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 */
+}
/** LLVMInitializeAllTargets - The main program should call this function if it
wants to link in all available targets that LLVM is configured to
support. */
-void LLVMInitializeAllTargets(void);
+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 */
+}
/** LLVMInitializeAllTargetMCs - The main program should call this function if
it wants access to all available target MC that LLVM is configured to
support. */
-void LLVMInitializeAllTargetMCs(void);
-
+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 */
+}
+
/** 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. */
-void LLVMInitializeAllAsmPrinters(void);
-
+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 */
+}
+
/** 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. */
-void LLVMInitializeAllAsmParsers(void);
-
+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 */
+}
+
/** 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. */
-void LLVMInitializeAllDisassemblers(void);
-
+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 */
+}
+
/** 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. */