Class: LLVM::Context

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ptr = nil) ⇒ Context

: (?FFI::Pointer?) -> void



7
8
9
# File 'lib/llvm/core/context.rb', line 7

def initialize(ptr = nil)
  @ptr = ptr || C.context_create() #: FFI::Pointer?
end

Class Method Details

.globalObject

Obtains a reference to the global Context. : -> Context



19
20
21
# File 'lib/llvm/core/context.rb', line 19

def self.global
  new(C.get_global_context())
end

Instance Method Details

#disposeObject

Diposes the Context. : -> void



25
26
27
28
29
# File 'lib/llvm/core/context.rb', line 25

def dispose
  return if @ptr.nil?
  C.context_dispose(@ptr)
  @ptr = nil
end

#to_ptrObject

: -> FFI::Pointer?



13
14
15
# File 'lib/llvm/core/context.rb', line 13

def to_ptr
  @ptr
end