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



149
150
151
# File 'lib/llvm/execution_engine.rb', line 149

def initialize(engine)
  @engine = engine
end

Instance Method Details

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



155
156
157
158
159
160
161
162
# File 'lib/llvm/execution_engine.rb', line 155

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