sun::codegen::CodegenState

sun::codegen::CodegenState

class · Source (opens in a new tab)

class sun::codegen::CodegenState

The state shared by every part of a codegen run.

Held by value on CodegenVisitor and handed to each component by reference.

Types

Public Functions

CodegenState

CodegenState(const CodegenState &)=delete

public · function · Source (opens in a new tab)

sun::codegen::CodegenState::CodegenState(const CodegenState &)=delete

Connects 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") const

Derive 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 &)=delete

Disallows 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::analysis

No documentation comment.

Related: sun::semantic_analysis::AnalysisResults

ctx

public · variable · Source (opens in a new tab)

CodegenContext& sun::codegen::CodegenState::ctx

No documentation comment.

Related: CodegenContext

debugInfo

public · variable · Source (opens in a new tab)

sun::codegen::DebugInfoBuilder sun::codegen::CodegenState::debugInfo

No documentation comment.

Related: sun::codegen::DebugInfoBuilder

frame

public · variable · Source (opens in a new tab)

FunctionFrame sun::codegen::CodegenState::frame

No documentation comment.

Related: FunctionFrame

module

public · variable · Source (opens in a new tab)

llvm::Module* sun::codegen::CodegenState::module

No documentation comment.

typeRegistry

public · variable · Source (opens in a new tab)

std::shared_ptr<sun::semantic_analysis::TypeRegistry> sun::codegen::CodegenState::typeRegistry

No documentation comment.

Related: sun::semantic_analysis::TypeRegistry

typeResolver

public · variable · Source (opens in a new tab)

LLVMTypeResolver sun::codegen::CodegenState::typeResolver

No documentation comment.

Related: LLVMTypeResolver