mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-27 06:54:30 +00:00
Add bindings for the rest of the MCJIT options that we previously
had support for. We're still missing a binding for an MCJIT memory manager. llvm-svn: 223153
This commit is contained in:
parent
0ddaaf1c85
commit
ba5c88412a
@ -39,6 +39,18 @@ func (options *MCJITCompilerOptions) SetMCJITOptimizationLevel(level uint) {
|
|||||||
options.C.OptLevel = C.uint(level)
|
options.C.OptLevel = C.uint(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (options *MCJITCompilerOptions) SetMCJITNoFramePointerElim(nfp bool) {
|
||||||
|
options.C.NoFramePointerElim = boolToLLVMBool(nfp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (options *MCJITCompilerOptions) SetMCJITEnableFastISel(fastisel bool) {
|
||||||
|
options.C.EnableFastISel = boolToLLVMBool(fastisel)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (options *MCJITCompilerOptions) SetMCJITCodeModel(CodeModel CodeModel) {
|
||||||
|
options.C.CodeModel = C.LLVMCodeModel(CodeModel)
|
||||||
|
}
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
func llvmGenericValueRefPtr(t *GenericValue) *C.LLVMGenericValueRef {
|
func llvmGenericValueRefPtr(t *GenericValue) *C.LLVMGenericValueRef {
|
||||||
return (*C.LLVMGenericValueRef)(unsafe.Pointer(t))
|
return (*C.LLVMGenericValueRef)(unsafe.Pointer(t))
|
||||||
|
@ -68,6 +68,9 @@ func TestFactorial(t *testing.T) {
|
|||||||
|
|
||||||
options := NewMCJITCompilerOptions()
|
options := NewMCJITCompilerOptions()
|
||||||
options.SetMCJITOptimizationLevel(2)
|
options.SetMCJITOptimizationLevel(2)
|
||||||
|
options.SetMCJITEnableFastISel(true)
|
||||||
|
options.SetMCJITNoFramePointerElim(true)
|
||||||
|
options.SetMCJITCodeModel(CodeModelJITDefault)
|
||||||
engine, err := NewMCJITCompiler(mod, options)
|
engine, err := NewMCJITCompiler(mod, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error creating JIT: %s", err)
|
t.Errorf("Error creating JIT: %s", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user