Class: LLVM::MCJITCompiler

Inherits:
ExecutionEngine show all
Defined in:
lib/llvm/execution_engine.rb

Instance Method Summary collapse

Methods inherited from ExecutionEngine

#data_layout, #dispose, #functions, #modules, #pointer_to_global, #run_function, #target_machine, #to_ptr

Constructor Details

#initialize(mod, options = {}) ⇒ ExecutionEngine

TODO:

Add :mcjmm option (MCJIT memory manager)

Note:

You should call ‘LLVM.init_jit(true)` before creating an execution engine.

Create a MCJIT execution engine.

Parameters:

  • mod (LLVM::Module)

    module

  • options (Hash{Symbol => Object}) (defaults to: {})

    options

Options Hash (options):

  • :opt_level (Integer) — default: 2

    Optimization level

  • :code_model (Integer) — default: 0

    Code model types

  • :no_frame_pointer_elim (Boolean) — default: false

    Disable frame pointer elimination optimization

  • :enable_fast_i_sel (Boolean) — default: false

    Enables fast-path instruction selection



211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/llvm/execution_engine.rb', line 211

def initialize(mod, options = {})
  options = {
    :opt_level             => 2, # LLVMCodeGenLevelDefault
    :code_model            => 0, # LLVMCodeModelDefault
    :no_frame_pointer_elim => false,
    :enable_fast_i_sel     => false,
    # TODO
    #:mcjmm                 => nil,
  }.merge(options)

  super
end