[llvm] r223153 - Add bindings for the rest of the MCJIT options that we previously

Eric Christopher echristo at gmail.com
Tue Dec 2 13:09:01 PST 2014


Author: echristo
Date: Tue Dec  2 15:09:01 2014
New Revision: 223153

URL: http://llvm.org/viewvc/llvm-project?rev=223153&view=rev
Log:
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.

Modified:
    llvm/trunk/bindings/go/llvm/executionengine.go
    llvm/trunk/bindings/go/llvm/executionengine_test.go

Modified: llvm/trunk/bindings/go/llvm/executionengine.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/executionengine.go?rev=223153&r1=223152&r2=223153&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/executionengine.go (original)
+++ llvm/trunk/bindings/go/llvm/executionengine.go Tue Dec  2 15:09:01 2014
@@ -39,6 +39,18 @@ func (options *MCJITCompilerOptions) Set
 	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))

Modified: llvm/trunk/bindings/go/llvm/executionengine_test.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/executionengine_test.go?rev=223153&r1=223152&r2=223153&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/executionengine_test.go (original)
+++ llvm/trunk/bindings/go/llvm/executionengine_test.go Tue Dec  2 15:09:01 2014
@@ -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)





More information about the llvm-commits mailing list