Class: LLVM::Context
- Inherits:
-
Object
- Object
- LLVM::Context
- Defined in:
- lib/llvm/core/context.rb
Class Method Summary collapse
-
.global ⇒ Object
Obtains a reference to the global Context.
Instance Method Summary collapse
-
#dispose ⇒ Object
Diposes the Context.
-
#initialize(ptr = nil) ⇒ Context
constructor
A new instance of Context.
- #to_ptr ⇒ Object
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
.global ⇒ Object
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
#dispose ⇒ Object
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_ptr ⇒ Object
8 9 10 |
# File 'lib/llvm/core/context.rb', line 8 def to_ptr @ptr end |