From 6fc4b1440d992060a4b849b5504c21256c348a9b Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 26 Nov 2014 02:54:24 +0000 Subject: Make SetMCJITOptimizationLevel more of a method and pass options as a reference. Move closer to the type. llvm-svn: 222805 --- llvm/bindings/go/llvm/executionengine.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/bindings/go/llvm/executionengine.go') diff --git a/llvm/bindings/go/llvm/executionengine.go b/llvm/bindings/go/llvm/executionengine.go index db2c2153401..141883975f8 100644 --- a/llvm/bindings/go/llvm/executionengine.go +++ b/llvm/bindings/go/llvm/executionengine.go @@ -35,6 +35,10 @@ type MCJITCompilerOptions struct { C C.struct_LLVMMCJITCompilerOptions } +func (options *MCJITCompilerOptions) SetMCJITOptimizationLevel(level uint) { + options.C.OptLevel = C.uint(level) +} + // helpers func llvmGenericValueRefPtr(t *GenericValue) *C.LLVMGenericValueRef { return (*C.LLVMGenericValueRef)(unsafe.Pointer(t)) @@ -100,10 +104,6 @@ func NewMCJITCompilerOptions() MCJITCompilerOptions { return MCJITCompilerOptions{options} } -func SetMCJITOptimizationLevel(options MCJITCompilerOptions, level uint) { - options.C.OptLevel = C.uint(level) -} - func NewMCJITCompiler(m Module, options MCJITCompilerOptions) (ee ExecutionEngine, err error) { var cmsg *C.char fail := C.LLVMCreateMCJITCompilerForModule(&ee.C, m.C, &options.C, C.size_t(unsafe.Sizeof(C.struct_LLVMMCJITCompilerOptions{})), &cmsg) -- cgit v1.2.1