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.
5 6 7 |
# File 'lib/llvm/core/context.rb', line 5 def initialize(ptr = nil) @ptr = ptr || C.context_create() end |
Class Method Details
.global ⇒ Object
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
#dispose ⇒ Object
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_ptr ⇒ Object
10 11 12 |
# File 'lib/llvm/core/context.rb', line 10 def to_ptr @ptr end |