9.0
6 JIT
Functions for JIT compilation and execution of LLVM IR.
6.1 Execution Engine
procedure
→ LLVMExecutionEngineRef? module : LLVMModuleRef?
return an execution engine for given module
procedure
(llvm-get-function-address engine name)
→ exact-nonnegative-integer? engine : LLVMExecutionEngineRef? name : string?
Returns the address of the compiled function with the given name. The returned integer can be cast to a function pointer using Racket FFI.
procedure
→ LLVMTargetDataRef? engine : LLVMExecutionEngineRef?
Returns the target data associated with the execution engine.
procedure
→ LLVMTargetMachineRef? engine : LLVMExecutionEngineRef?
Returns the target machine associated with the execution engine.
6.2 Running Functions
procedure
(llvm-run-function engine function) → LLVMGenericValueRef?
engine : LLVMExecutionEngineRef? function : LLVMValueRef?
6.3 Generic Values
Generic values are used to pass arguments to and receive results from JIT-compiled functions.
procedure
(llvm-create-generic-value-of-int type value signed?) → LLVMGenericValueRef? type : LLVMTypeRef? value : integer? signed? : boolean?
Converted given value to LLVMGenericValueRef?.
type decided it’s LLVM type corresponding.
signed? decided it’s signed integer or not.
procedure
(llvm-create-generic-value-of-float type value) → LLVMGenericValueRef? type : LLVMTypeRef? value : number?
procedure
(llvm-generic-value->int generic-value signed?) → integer? generic-value : LLVMGenericValueRef? signed? : boolean?
procedure
(llvm-generic-value-to-float type generic-value) → number? type : LLVMTypeRef? generic-value : LLVMGenericValueRef?
convert generic-value back to racket number?