Start to clean things up to get into a state usable by others.
[cl-llvm.git] / src / generated / execution-engine.lisp
blob18c24f16e018fec97bd7873b7b0c832a22f695e1
1 ;;; This file was automatically generated by SWIG (http://www.swig.org).
2 ;;; Version 1.3.40
3 ;;;
4 ;;; Do not make changes to this file unless you know what you are doing--modify
5 ;;; the SWIG interface file instead.
7 (in-package :llvm)
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
19 (Ty LLVMTypeRef)
20 (N :unsigned-long-long)
21 (IsSigned :boolean))
23 (cffi:defcfun ("LLVMCreateGenericValueOfPointer" LLVMCreateGenericValueOfPointer) LLVMGenericValueRef
24 (P :pointer))
26 (cffi:defcfun ("LLVMCreateGenericValueOfFloat" LLVMCreateGenericValueOfFloat) LLVMGenericValueRef
27 (Ty LLVMTypeRef)
28 (N :double))
30 (cffi:defcfun ("LLVMGenericValueIntWidth" LLVMGenericValueIntWidth) :unsigned-int
31 (GenValRef LLVMGenericValueRef))
33 (cffi:defcfun ("LLVMGenericValueToInt" LLVMGenericValueToInt) :unsigned-long-long
34 (GenVal LLVMGenericValueRef)
35 (IsSigned :boolean))
37 (cffi:defcfun ("LLVMGenericValueToPointer" LLVMGenericValueToPointer) :pointer
38 (GenVal LLVMGenericValueRef))
40 (cffi:defcfun ("LLVMGenericValueToFloat" LLVMGenericValueToFloat) :double
41 (TyRef LLVMTypeRef)
42 (GenVal LLVMGenericValueRef))
44 (cffi:defcfun ("LLVMDisposeGenericValue" LLVMDisposeGenericValue) :void
45 (GenVal LLVMGenericValueRef))
47 (cffi:defcfun ("LLVMCreateExecutionEngine" LLVMCreateExecutionEngine) :boolean
48 (OutEE :pointer)
49 (MP LLVMModuleProviderRef)
50 (OutError :pointer))
52 (cffi:defcfun ("LLVMCreateInterpreter" LLVMCreateInterpreter) :boolean
53 (OutInterp :pointer)
54 (MP LLVMModuleProviderRef)
55 (OutError :pointer))
57 (cffi:defcfun ("LLVMCreateJITCompiler" %LLVMCreateJITCompiler) :boolean
58 (OutJIT :pointer)
59 (MP LLVMModuleProviderRef)
60 (OptLevel :unsigned-int)
61 (OutError :pointer))
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) :boolean
73 (EE LLVMExecutionEngineRef)
74 (F LLVMValueRef)
75 (ArgC :unsigned-int)
76 (ArgV :pointer)
77 (EnvP :pointer))
79 (cffi:defcfun ("LLVMRunFunction" LLVMRunFunction) LLVMGenericValueRef
80 (EE LLVMExecutionEngineRef)
81 (F LLVMValueRef)
82 (NumArgs :unsigned-int)
83 (Args :pointer))
85 (cffi:defcfun ("LLVMFreeMachineCodeForFunction" LLVMFreeMachineCodeForFunction) :void
86 (EE LLVMExecutionEngineRef)
87 (F LLVMValueRef))
89 (cffi:defcfun ("LLVMAddModuleProvider" LLVMAddModuleProvider) :void
90 (EE LLVMExecutionEngineRef)
91 (MP LLVMModuleProviderRef))
93 (cffi:defcfun ("LLVMRemoveModuleProvider" LLVMRemoveModuleProvider) :boolean
94 (EE LLVMExecutionEngineRef)
95 (MP LLVMModuleProviderRef)
96 (OutMod :pointer)
97 (OutError :pointer))
99 (cffi:defcfun ("LLVMFindFunction" LLVMFindFunction) :boolean
100 (EE LLVMExecutionEngineRef)
101 (Name :string)
102 (OutFn :pointer))
104 (cffi:defcfun ("LLVMGetExecutionEngineTargetData" LLVMGetExecutionEngineTargetData) LLVMTargetDataRef
105 (EE LLVMExecutionEngineRef))
107 (cffi:defcfun ("LLVMAddGlobalMapping" LLVMAddGlobalMapping) :void
108 (EE LLVMExecutionEngineRef)
109 (Global LLVMValueRef)
110 (Addr :pointer))
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)))))