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, #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



171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/llvm/execution_engine.rb', line 171

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