Class: LLVM::ExecutionEngine::FunctionCollection

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

Instance Method Summary collapse

Constructor Details

#initialize(engine) ⇒ FunctionCollection

Returns a new instance of FunctionCollection.

Parameters:


137
138
139
# File 'lib/llvm/execution_engine.rb', line 137

def initialize(engine)
  @engine = engine
end

Instance Method Details

#named(name) ⇒ Function Also known as: []

Parameters:

  • name (String, Symbol)

    function name

Returns:


143
144
145
146
147
148
149
150
# File 'lib/llvm/execution_engine.rb', line 143

def named(name)
  out_fun = FFI::MemoryPointer.new(:pointer)

  status = C.find_function(@engine, name.to_s, out_fun)
  return unless status.zero?

  Function.from_ptr(out_fun.read_pointer)
end