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.



5
6
7
# File 'lib/llvm/core/context.rb', line 5

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

Class Method Details

.globalObject

Obtains a reference to the global Context.



15
16
17
# File 'lib/llvm/core/context.rb', line 15

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

Instance Method Details

#disposeObject

Diposes the Context.



20
21
22
23
24
# File 'lib/llvm/core/context.rb', line 20

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

#to_ptrObject



10
11
12
# File 'lib/llvm/core/context.rb', line 10

def to_ptr
  @ptr
end