Class: Carbon::Tacky::Context Private
- Inherits:
-
Object
- Object
- Carbon::Tacky::Context
- Extended by:
- Forwardable
- Defined in:
- lib/carbon/tacky/context.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A "context." This contains all of the information needed to build a function, such as instruction values (From LLVM), block mapping, parameters, and the build (Concrete::Build).
Instance Attribute Summary collapse
-
#blocks ⇒ {Tacky::Block => ::LLVM::BasicBlock}
readonly
private
The mapping for blocks.
-
#build ⇒ Concrete::Build
readonly
private
The actual build.
-
#function ⇒ Tacky::Function
readonly
private
Returns the function that this is being built for.
-
#generics ⇒ {::String => Concrete::Type}
readonly
private
The generics that the function is being built with.
-
#instructions ⇒ <::LLVM::Value>
readonly
private
The values of instructions.
-
#items ⇒ {Concrete::Type => (Concrete::Item, ::LLVM::Value)}
readonly
The types that have been defined.
-
#params ⇒ <::LLVM::Value>
readonly
private
The parameters that are passed from the function.
Instance Method Summary collapse
-
#initialize(function, build, generics) ⇒ Context
constructor
private
Initialize the context.
Constructor Details
#initialize(function, build, generics) ⇒ Context
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the context.
60 61 62 63 64 65 66 67 68 |
# File 'lib/carbon/tacky/context.rb', line 60 def initialize(function, build, generics) @function = function @build = build @generics = generics @instructions = [] @blocks = {} @params = [] freeze end |
Instance Attribute Details
#blocks ⇒ {Tacky::Block => ::LLVM::BasicBlock} (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The mapping for blocks. This is used by instructions to map a
Block to the proper LLVM::BasicBlock
, since many llvm
instructions take basic blocks as parameters.
26 27 28 |
# File 'lib/carbon/tacky/context.rb', line 26 def blocks @blocks end |
#build ⇒ Concrete::Build (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The actual build.
42 43 44 |
# File 'lib/carbon/tacky/context.rb', line 42 def build @build end |
#function ⇒ Tacky::Function (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the function that this is being built for.
53 54 55 |
# File 'lib/carbon/tacky/context.rb', line 53 def function @function end |
#generics ⇒ {::String => Concrete::Type} (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The generics that the function is being built with.
31 32 33 |
# File 'lib/carbon/tacky/context.rb', line 31 def generics @generics end |
#instructions ⇒ <::LLVM::Value> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The values of instructions. This is used to properly map
Reference values to the proper LLVM::Value
s.
19 20 21 |
# File 'lib/carbon/tacky/context.rb', line 19 def instructions @instructions end |
#items ⇒ {Concrete::Type => (Concrete::Item, ::LLVM::Value)} (readonly)
The types that have been defined. This is a mapping of the
Concrete::Type to an arry of the Concrete::Item and the
corresponding LLVM::Type
. This is so that no information is lost
when converting the item to the type.
45 46 47 |
# File 'lib/carbon/tacky/context.rb', line 45 def items @items end |
#params ⇒ <::LLVM::Value> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The parameters that are passed from the function. This is used to
convert Parameter references to LLVM::Value
s.
37 38 39 |
# File 'lib/carbon/tacky/context.rb', line 37 def params @params end |