1 ;;; This file was automatically generated by SWIG (http://www.swig.org).
4 ;;; Do not make changes to this file unless you know what you are doing--modify
5 ;;; the SWIG interface file instead.
10 (cffi:defcfun
("LLVMLinkInJIT" LLVMLinkInJIT
) :void
)
12 (cffi:defcfun
("LLVMLinkInInterpreter" LLVMLinkInInterpreter
) :void
)
14 (cffi:defctype LLVMGenericValueRef
:pointer
)
16 (cffi:defctype LLVMExecutionEngineRef
:pointer
)
18 (cffi:defcfun
("LLVMCreateGenericValueOfInt" LLVMCreateGenericValueOfInt
) LLVMGenericValueRef
20 (N :unsigned-long-long
)
23 (cffi:defcfun
("LLVMCreateGenericValueOfPointer" LLVMCreateGenericValueOfPointer
) LLVMGenericValueRef
26 (cffi:defcfun
("LLVMCreateGenericValueOfFloat" LLVMCreateGenericValueOfFloat
) LLVMGenericValueRef
30 (cffi:defcfun
("LLVMGenericValueIntWidth" LLVMGenericValueIntWidth
) :unsigned-int
31 (GenValRef LLVMGenericValueRef
))
33 (cffi:defcfun
("LLVMGenericValueToInt" LLVMGenericValueToInt
) :unsigned-long-long
34 (GenVal LLVMGenericValueRef
)
37 (cffi:defcfun
("LLVMGenericValueToPointer" LLVMGenericValueToPointer
) :pointer
38 (GenVal LLVMGenericValueRef
))
40 (cffi:defcfun
("LLVMGenericValueToFloat" LLVMGenericValueToFloat
) :double
42 (GenVal LLVMGenericValueRef
))
44 (cffi:defcfun
("LLVMDisposeGenericValue" LLVMDisposeGenericValue
) :void
45 (GenVal LLVMGenericValueRef
))
47 (cffi:defcfun
("LLVMCreateExecutionEngine" LLVMCreateExecutionEngine
) :boolean
49 (MP LLVMModuleProviderRef
)
52 (cffi:defcfun
("LLVMCreateInterpreter" LLVMCreateInterpreter
) :boolean
54 (MP LLVMModuleProviderRef
)
57 (cffi:defcfun
("LLVMCreateJITCompiler" %LLVMCreateJITCompiler
) :boolean
59 (MP LLVMModuleProviderRef
)
60 (OptLevel :unsigned-int
)
63 (cffi:defcfun
("LLVMDisposeExecutionEngine" LLVMDisposeExecutionEngine
) :void
64 (EE LLVMExecutionEngineRef
))
66 (cffi:defcfun
("LLVMRunStaticConstructors" LLVMRunStaticConstructors
) :void
67 (EE LLVMExecutionEngineRef
))
69 (cffi:defcfun
("LLVMRunStaticDestructors" LLVMRunStaticDestructors
) :void
70 (EE LLVMExecutionEngineRef
))
72 (cffi:defcfun
("LLVMRunFunctionAsMain" LLVMRunFunctionAsMain
) :int
73 (EE LLVMExecutionEngineRef
)
79 (cffi:defcfun
("LLVMRunFunction" LLVMRunFunction
) LLVMGenericValueRef
80 (EE LLVMExecutionEngineRef
)
82 (NumArgs :unsigned-int
)
85 (cffi:defcfun
("LLVMFreeMachineCodeForFunction" LLVMFreeMachineCodeForFunction
) :void
86 (EE LLVMExecutionEngineRef
)
89 (cffi:defcfun
("LLVMAddModuleProvider" LLVMAddModuleProvider
) :void
90 (EE LLVMExecutionEngineRef
)
91 (MP LLVMModuleProviderRef
))
93 (cffi:defcfun
("LLVMRemoveModuleProvider" LLVMRemoveModuleProvider
) :boolean
94 (EE LLVMExecutionEngineRef
)
95 (MP LLVMModuleProviderRef
)
99 (cffi:defcfun
("LLVMFindFunction" LLVMFindFunction
) :boolean
100 (EE LLVMExecutionEngineRef
)
104 (cffi:defcfun
("LLVMGetExecutionEngineTargetData" LLVMGetExecutionEngineTargetData
) LLVMTargetDataRef
105 (EE LLVMExecutionEngineRef
))
107 (cffi:defcfun
("LLVMAddGlobalMapping" LLVMAddGlobalMapping
) :void
108 (EE LLVMExecutionEngineRef
)
109 (Global LLVMValueRef
)
112 (cffi:defcfun
("LLVMGetPointerToGlobal" LLVMGetPointerToGlobal
) :pointer
113 (EE LLVMExecutionEngineRef
)
114 (Global LLVMValueRef
))
117 (defun LLVMCreateJITCompiler (provider opt
)
118 (cffi:with-foreign-objects
((out-engine :pointer
)
119 (out-error-str :pointer
))
120 (if (null (%LLVMCreateJITCompiler out-engine provider opt out-error-str
))
121 (cffi:mem-ref out-engine
:pointer
)
122 (let* ((error-str (cffi:mem-ref out-error-str
:pointer
))
123 (error-str-lisp (cffi:foreign-string-to-lisp error-str
)))
124 (LLVMDisposeMessage error-str
)
125 (error "LLVMCreateJITCompiler: ~s" error-str-lisp
)))))