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
("CLLLVM_LLVMInitializeNativeTarget" CLLLVM_LLVMInitializeNativeTarget
) :int
)
12 (cffi:defcfun
("CLLLVM_LLVMModuleProviderGetModule" CLLLVM_LLVMModuleProviderGetModule
) LLVMModuleRef
13 (modprovider LLVMModuleProviderRef
))
15 (cffi:defcfun
("CLLLVM_LLVMParseAssemblyString" CLLLVM_LLVMParseAssemblyString
) LLVMModuleRef
18 (Context LLVMContextRef
))
20 (cffi:defcfun
("CLLLVM_LLVMIntPtrTypeInContext" CLLLVM_LLVMIntPtrTypeInContext
) LLVMTypeRef
21 (Context LLVMContextRef
)
22 (TD LLVMTargetDataRef
))
24 (cffi:defcfun
("CLLLVM_LLVMDumpModuleToString" CLLLVM_LLVMDumpModuleToString
) :string
25 (module LLVMModuleRef
))
27 (cffi:defcfun
("CLLLVM_LLVMDumpTypeToString" CLLLVM_LLVMDumpTypeToString
) :string
30 (cffi:defcfun
("CLLLVM_LLVMDumpValueToString" CLLLVM_LLVMDumpValueToString
) :string
33 (cffi:defcfun
("CLLLVM_LLVMAddFunctionAttr" LLVMAddFunctionAttr
) :void
37 (cffi:defcfun
("CLLLVM_LLVMRemoveFunctionAttr" LLVMRemoveFunctionAttr
) :void
41 (cffi:defcfun
("CLLLVM_LLVMAddRetAttr" LLVMAddRetAttr
) :void
45 (cffi:defcfun
("CLLLVM_LLVMRemoveRetAttr" LLVMRemoveRetAttr
) :void
49 (cffi:defcfun
("CLLLVM_LLVMGetRetAttr" LLVMGetRetAttr
) LLVMAttribute
52 (cffi:defcfun
("CLLLVM_LLVMConstIntOfBigVal" LLVMConstIntOfBigVal
) LLVMValueRef
54 (numWords :unsigned-int
)
57 (cffi:defcfun
("CLLLVM_AddPrintAsmPass" CLLLVM_AddPrintAsmPass
) :void
58 (PM LLVMPassManagerRef
)
61 (defun LLVMConstInt (Ty Num
)
62 (declare (type integer Num
))
63 ;; If the type is <= 64 bits, it's easy: we can just pass the
64 ;; (truncated) number into %LLVMConstInt directly. Otherwise,
65 ;; convert the number to a bunch of 64-bit words, and pass those to
66 ;; LLVMConstIntOfBigVal.
67 (let ((bitwidth (LLVMGetIntTypeWidth Ty
)))
69 (%LLVMConstInt Ty
(logand Num
#xffffffffffffffff
) 0)
70 (let ((n-words (ceiling bitwidth
64)))
71 (cffi:with-foreign-object
(array :unsigned-long-long n-words
)
72 (loop for i from
0 below n-words
74 (setf (cffi:mem-aref array
:unsigned-long-long i
)
75 (logand Num
#xffffffffffffffff
))
76 (setf Num
(ash Num -
64)))
77 (LLVMConstIntOfBigVal Ty n-words array
))))))