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:



143
144
145
# File 'lib/llvm/execution_engine.rb', line 143

def initialize(engine)
  @engine = engine
end

Instance Method Details

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

Parameters:

  • name (String, Symbol)

    function name

Returns:



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

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