sun::codegen::CodegenState
class · Source (opens in a new tab)
class sun::codegen::CodegenStateThe state shared by every part of a codegen run.
Held by value on CodegenVisitor and handed to each component by reference.
Types
- sun::codegen::CodegenState::ReceiverGuard (public)
- sun::codegen::CodegenState::ReturnGuard (public)
- sun::codegen::CodegenState::InsertPointGuard (public)
Public Functions
CodegenState
CodegenState(const CodegenState &)=delete
public · function · Source (opens in a new tab)
sun::codegen::CodegenState::CodegenState(const CodegenState &)=deleteConnects LLVM generation state to the semantic type registry.
CodegenState(CodegenContext &ctx, std::shared_ptr< sun::semantic_analysis::AnalysisResults > results)
public · function · Source (opens in a new tab)
sun::codegen::CodegenState::CodegenState(CodegenContext &ctx, std::shared_ptr< sun::semantic_analysis::AnalysisResults > results)Connects LLVM generation state to the results of semantic analysis.
Related: CodegenContext, sun::semantic_analysis::AnalysisResults
builder
public · function · Source (opens in a new tab)
llvm::IRBuilder & sun::codegen::CodegenState::builder()Provides the LLVM instruction builder used by the active generator.
declarationSymbol
public · function · Source (opens in a new tab)
std::string sun::codegen::CodegenState::declarationSymbol(sun::semantic_analysis::DeclarationId id, const std::string &role="function") constDerive the linker spelling for an analyzed declaration and emission role.
Related: sun::semantic_analysis::DeclarationId
llvmContext
public · function · Source (opens in a new tab)
llvm::LLVMContext & sun::codegen::CodegenState::llvmContext()Provides the LLVM context that owns generated types and constants.
operator=
public · function · Source (opens in a new tab)
CodegenState & sun::codegen::CodegenState::operator=(const CodegenState &)=deleteDisallows assignment so ownership and object identity cannot be duplicated.
Related: CodegenState
Public Fields
analysis
public · variable · Source (opens in a new tab)
std::shared_ptr<sun::semantic_analysis::AnalysisResults> sun::codegen::CodegenState::analysisNo documentation comment.
Related: sun::semantic_analysis::AnalysisResults
ctx
public · variable · Source (opens in a new tab)
CodegenContext& sun::codegen::CodegenState::ctxNo documentation comment.
Related: CodegenContext
debugInfo
public · variable · Source (opens in a new tab)
sun::codegen::DebugInfoBuilder sun::codegen::CodegenState::debugInfoNo documentation comment.
Related: sun::codegen::DebugInfoBuilder
frame
public · variable · Source (opens in a new tab)
FunctionFrame sun::codegen::CodegenState::frameNo documentation comment.
Related: FunctionFrame
module
public · variable · Source (opens in a new tab)
llvm::Module* sun::codegen::CodegenState::moduleNo documentation comment.
typeRegistry
public · variable · Source (opens in a new tab)
std::shared_ptr<sun::semantic_analysis::TypeRegistry> sun::codegen::CodegenState::typeRegistryNo documentation comment.
Related: sun::semantic_analysis::TypeRegistry
typeResolver
public · variable · Source (opens in a new tab)
LLVMTypeResolver sun::codegen::CodegenState::typeResolverNo documentation comment.
Related: LLVMTypeResolver