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:



141
142
143
# File 'lib/llvm/execution_engine.rb', line 141

def initialize(engine)
  @engine = engine
end

Instance Method Details

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

Parameters:

  • name (String, Symbol)

    function name

Returns:



147
148
149
150
151
152
153
154
# File 'lib/llvm/execution_engine.rb', line 147

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