summaryrefslogtreecommitdiffstats
path: root/llvm/bindings/go
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-12-02 21:09:01 +0000
committerEric Christopher <echristo@gmail.com>2014-12-02 21:09:01 +0000
commit71ae83c4e1b98139f86666d5634f3f59bdc00e5a (patch)
tree931dc4c7023dd068f59705c1283eaa1cf331a932 /llvm/bindings/go
parent4a69bea6c20a66d014f61ac44a32b9a18b48218c (diff)
downloadbcm5719-llvm-71ae83c4e1b98139f86666d5634f3f59bdc00e5a.tar.gz
bcm5719-llvm-71ae83c4e1b98139f86666d5634f3f59bdc00e5a.zip
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
Diffstat (limited to 'llvm/bindings/go')
-rw-r--r--llvm/bindings/go/llvm/executionengine.go12
-rw-r--r--llvm/bindings/go/llvm/executionengine_test.go3
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/bindings/go/llvm/executionengine.go b/llvm/bindings/go/llvm/executionengine.go
index 23c185c010b..94d4e83b4cf 100644
--- a/llvm/bindings/go/llvm/executionengine.go
+++ b/llvm/bindings/go/llvm/executionengine.go
@@ -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))
diff --git a/llvm/bindings/go/llvm/executionengine_test.go b/llvm/bindings/go/llvm/executionengine_test.go
index 03fabc83c6f..2b6a3caff3d 100644
--- a/llvm/bindings/go/llvm/executionengine_test.go
+++ b/llvm/bindings/go/llvm/executionengine_test.go
@@ -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)
OpenPOWER on IntegriCloud