aboutsummaryrefslogtreecommitdiffhomepage
path: root/ext/llvm-sys.rs/wrappers/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/llvm-sys.rs/wrappers/target.c')
-rw-r--r--ext/llvm-sys.rs/wrappers/target.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/ext/llvm-sys.rs/wrappers/target.c b/ext/llvm-sys.rs/wrappers/target.c
new file mode 100644
index 0000000..66035c1
--- /dev/null
+++ b/ext/llvm-sys.rs/wrappers/target.c
@@ -0,0 +1,48 @@
+/* llvm-c/Target.h helper functions wrappers.
+ *
+ * The LLVMInitializeAll* functions and friends are defined `static inline`, so
+ * we can't bind directly to them (the function body is generated via macro),
+ * so here are some wrappers.
+ */
+#include <llvm-c/Target.h>
+
+void LLVM_InitializeAllTargetInfos(void) {
+ LLVMInitializeAllTargetInfos();
+}
+
+void LLVM_InitializeAllTargets(void) {
+ LLVMInitializeAllTargets();
+}
+
+void LLVM_InitializeAllTargetMCs(void) {
+ LLVMInitializeAllTargetMCs();
+}
+
+void LLVM_InitializeAllAsmPrinters(void) {
+ LLVMInitializeAllAsmPrinters();
+}
+
+void LLVM_InitializeAllAsmParsers(void) {
+ LLVMInitializeAllAsmParsers();
+}
+
+void LLVM_InitializeAllDisassemblers(void) {
+ LLVMInitializeAllDisassemblers();
+}
+
+/* These functions return true on failure. */
+LLVMBool LLVM_InitializeNativeTarget(void) {
+ return LLVMInitializeNativeTarget();
+}
+
+LLVMBool LLVM_InitializeNativeAsmParser(void) {
+ return LLVMInitializeNativeAsmParser();
+}
+
+LLVMBool LLVM_InitializeNativeAsmPrinter(void) {
+ return LLVMInitializeNativeAsmPrinter();
+}
+
+LLVMBool LLVM_InitializeNativeDisassembler(void) {
+ return LLVMInitializeNativeDisassembler();
+}