Add bindings for the rest of the MCJIT options that we previously
authorEric Christopher <echristo@gmail.com>
Tue, 2 Dec 2014 21:09:01 +0000 (21:09 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 2 Dec 2014 21:09:01 +0000 (21:09 +0000)
had support for. We're still missing a binding for an MCJIT
memory manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223153 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/go/llvm/executionengine.go
bindings/go/llvm/executionengine_test.go

index 23c185c010b40ad1c21a9aec7e5190bf7cc01c1d..94d4e83b4cf33e8c5126cf442f4fd9fce64c6b05 100644 (file)
@@ -39,6 +39,18 @@ func (options *MCJITCompilerOptions) SetMCJITOptimizationLevel(level uint) {
        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
 func llvmGenericValueRefPtr(t *GenericValue) *C.LLVMGenericValueRef {
        return (*C.LLVMGenericValueRef)(unsafe.Pointer(t))
index 03fabc83c6ff49a16cfbdbe1de39436d5c9e375d..2b6a3caff3df45082394f22bb2e394c9f659647b 100644 (file)
@@ -68,6 +68,9 @@ func TestFactorial(t *testing.T) {
 
        options := NewMCJITCompilerOptions()
        options.SetMCJITOptimizationLevel(2)
+       options.SetMCJITEnableFastISel(true)
+       options.SetMCJITNoFramePointerElim(true)
+       options.SetMCJITCodeModel(CodeModelJITDefault)
        engine, err := NewMCJITCompiler(mod, options)
        if err != nil {
                t.Errorf("Error creating JIT: %s", err)