llvm.org GIT mirror llvm / 73271f0
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223153 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 5 years ago
2 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3636
3737 func (options *MCJITCompilerOptions) SetMCJITOptimizationLevel(level uint) {
3838 options.C.OptLevel = C.uint(level)
39 }
40
41 func (options *MCJITCompilerOptions) SetMCJITNoFramePointerElim(nfp bool) {
42 options.C.NoFramePointerElim = boolToLLVMBool(nfp)
43 }
44
45 func (options *MCJITCompilerOptions) SetMCJITEnableFastISel(fastisel bool) {
46 options.C.EnableFastISel = boolToLLVMBool(fastisel)
47 }
48
49 func (options *MCJITCompilerOptions) SetMCJITCodeModel(CodeModel CodeModel) {
50 options.C.CodeModel = C.LLVMCodeModel(CodeModel)
3951 }
4052
4153 // helpers
6767
6868 options := NewMCJITCompilerOptions()
6969 options.SetMCJITOptimizationLevel(2)
70 options.SetMCJITEnableFastISel(true)
71 options.SetMCJITNoFramePointerElim(true)
72 options.SetMCJITCodeModel(CodeModelJITDefault)
7073 engine, err := NewMCJITCompiler(mod, options)
7174 if err != nil {
7275 t.Errorf("Error creating JIT: %s", err)