Class: LLVM::JITCompiler

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

Note:

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

Create a JIT execution engine.

Parameters:

  • mod (LLVM::Module)

    module

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

    options

Options Hash (options):

  • :opt_level (Integer) — default: 3

    Optimization level



178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/llvm/execution_engine.rb', line 178

def initialize(mod, options = {})
  # Prior to ruby-llvm 3.4.0, signature is initialize(mod, opt_level = 3)
  if options.kind_of?(Integer)
    options = { :opt_level => options }
  end

  options = {
    :opt_level => 3,
  }.merge(options)

  super
end