class Carbon::Tacky::Context
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}).
@api private
Attributes
The mapping for blocks. This is used by instructions to map a {Tacky::Block} to the proper `LLVM::BasicBlock`, since many llvm instructions take basic blocks as parameters.
@return [{Tacky::Block => ::LLVM::BasicBlock}]
The actual build.
@return [Concrete::Build]
Returns the function that this is being built for.
@return [Tacky::Function]
The generics that the function is being built with.
@return [{::String => Concrete::Type}]
The values of instructions. This is used to properly map {Tacky::Reference} values to the proper `LLVM::Value`s.
@return [<::LLVM::Value>]
(see Concrete::Build#items
)
The parameters that are passed from the function. This is used to convert {Tacky::Parameter} references to `LLVM::Value`s.
@return [<::LLVM::Value>]
Public Class Methods
Initialize the context.
@param function [Tacky::Function] @param build [Concrete::Build] @param generics [{::String => Concrete::Type}]
# File lib/carbon/tacky/context.rb, line 60 def initialize(function, build, generics) @function = function @build = build @generics = generics @instructions = [] @blocks = {} @params = [] freeze end