artiq/patches/llvmlite/0001-add-all-targets.patch

39 lines
1.1 KiB
Diff

diff --git a/ffi/initfini.cpp b/ffi/initfini.cpp
index 42c8965..067be62 100644
--- a/ffi/initfini.cpp
+++ b/ffi/initfini.cpp
@@ -37,9 +37,10 @@ LLVMPY_Shutdown(){
// NOTE: it is important that we don't export functions which we don't use,
// especially those which may pull in large amounts of additional code or data.
-// INIT(AllTargetInfos)
-// INIT(AllTargets)
-// INIT(AllTargetMCs)
+INIT(AllTargetInfos)
+INIT(AllTargets)
+INIT(AllTargetMCs)
+INIT(AllAsmPrinters)
INIT(NativeTarget)
INIT(NativeAsmParser)
INIT(NativeAsmPrinter)
diff --git a/llvmlite/binding/initfini.py b/llvmlite/binding/initfini.py
index bfaa5b2..7d0df11 100644
--- a/llvmlite/binding/initfini.py
+++ b/llvmlite/binding/initfini.py
@@ -8,6 +8,15 @@ def initialize():
ffi.lib.LLVMPY_InitializeCore()
+def initialize_all_targets():
+ ffi.lib.LLVMPY_InitializeAllTargetInfos()
+ ffi.lib.LLVMPY_InitializeAllTargets()
+ ffi.lib.LLVMPY_InitializeAllTargetMCs()
+
+def initialize_all_asmprinters():
+ ffi.lib.LLVMPY_InitializeAllAsmPrinters()
+
+
def initialize_native_target():
"""
Initialize the native (host) target. Necessary before doing any