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

Returns a new instance of Context.



3
4
5
# File 'lib/llvm/core/context.rb', line 3

def initialize(ptr = nil)
  @ptr = ptr || C.context_create()
end

Class Method Details

.globalObject

Obtains a reference to the global Context.



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

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

Instance Method Details

#disposeObject

Diposes the Context.



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

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

#to_ptrObject



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

def to_ptr
  @ptr
end