Wrap more stuff, move some things around.
[cl-llvm.git] / src / execution-engine.i
blob0ccd949fb50cb76addd2403586bcddc5bdac9638
1 %include "typemaps.i"
3 %rename LLVMCreateJITCompiler "%%LLVMCreateJITCompiler";
5 %include "llvm-c/ExecutionEngine.h"
7 %insert("swiglisp") %{
9 (defun LLVMCreateJITCompiler (provider opt)
10 (cffi:with-foreign-objects ((out-engine :pointer)
11 (out-error-str :pointer))
12 (if (null (%LLVMCreateJITCompiler out-engine provider opt out-error-str))
13 (cffi:mem-ref out-engine :pointer)
14 (let* ((error-str (cffi:mem-ref out-error-str :pointer))
15 (error-str-lisp (cffi:foreign-string-to-lisp error-str)))
16 (LLVMDisposeMessage error-str)
17 (error "LLVMCreateJITCompiler: ~s" error-str-lisp)))))
21 // TODO: lots of functions that need special wrappings