Class: LLVM::LLJit

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

Overview

wrapper around LLVMOrcLLJITRef

Defined Under Namespace

Modules: C

Instance Method Summary collapse

Constructor Details

#initializeLLJit

create lljit does not automatically dispose of lljit if lljit was disposed, that would dispose of builder



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/llvm/lljit.rb', line 12

def initialize
  builder = C.create_lljit_builder
  FFI::MemoryPointer.new(FFI.type_size(:pointer)) do |ptr|
    error = C.create_lljit(ptr, builder)
    if error.null?
      @ptr = ptr.read_pointer
    else
      message = C.get_error_message(error)
      raise message
    end
  end
end

Instance Method Details

#data_layoutObject



29
30
31
# File 'lib/llvm/lljit.rb', line 29

def data_layout
  C.get_data_layout_str(ptr)
end

#global_prefixObject



33
34
35
36
# File 'lib/llvm/lljit.rb', line 33

def global_prefix
  gp = C.get_global_prefix(ptr)
  gp.zero? ? "" : gp.chr
end

#triple_stringObject



25
26
27
# File 'lib/llvm/lljit.rb', line 25

def triple_string
  C.get_triple_string(ptr)
end