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



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

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



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

def data_layout
  C.get_data_layout_str(ptr)
end

#global_prefixObject



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

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

#triple_stringObject



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

def triple_string
  C.get_triple_string(ptr)
end