sun::semantic_analysis::passes

sun::semantic_analysis::passes

namespace · Source (opens in a new tab)

Provides the ordered passes for semantic analysis.

Declares the pass that makes types and templates available before resolution.

Provides the ordered preparation and registration passes for analysis.

Classes

Functions

assignLocalDeclarationName

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

void sun::semantic_analysis::passes::assignLocalDeclarationName(sun::ast::ExprAST &declaration, const std::vector< std::string > &scopePath)

Name the current local declaration and its methods without walking bodies.

Assigns a qualified name to a declaration within its lexical scope.

Related: sun::ast::ExprAST

clearComputedAnalysis

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

void sun::semantic_analysis::passes::clearComputedAnalysis(const ExprAST &root)

Clear computed annotations throughout a tree while preserving identities.

Clears computed annotations throughout the tree while retaining declaration identities.

Related: ExprAST

compatibleNativeFunctionTypes

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

static bool sun::semantic_analysis::passes::compatibleNativeFunctionTypes(const TypePtr &first, const TypePtr &second)

Compare independently declared C signatures, including record layouts.

Related: TypePtr

compatibleNativeTypes

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

static bool sun::semantic_analysis::passes::compatibleNativeTypes(const TypePtr &first, const TypePtr &second, std::vector< std::pair< const sun::types::Type *, const sun::types::Type * > > &seen)

Compare native type structure without equating unrelated Sun declarations.

Visited pairs terminate comparisons of recursive native record pointers.

Related: TypePtr, sun::types::Type

exceptionFieldLayout

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

static std::pair< std::size_t, std::size_t > sun::semantic_analysis::passes::exceptionFieldLayout(const TypePtr &type, const sun::support::Position &location)

Calculates bounded, trivially movable exception storage without owned pointers.

Related: TypePtr, sun::support::Position

forEachImportedBody

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

template <typename Visitor>
void sun::semantic_analysis::passes::forEachImportedBody(const std::vector< sun::ast::MoonScopeAST * > &imports, SemanticContext &context, Visitor &&visitor)

Visit each borrowed import body in its bundle scope and source file.

Restore the caller's scope and source file even if the visitor throws.

Related: sun::ast::MoonScopeAST, SemanticContext

resetAnalysisSession

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

void sun::semantic_analysis::passes::resetAnalysisSession(const ExprAST &root)

Discard tree annotations before attaching it to a new analysis session.

Discards analysis-session state throughout the syntax tree.

Related: ExprAST