sun::ast::VariableAssignmentAST

sun::ast::VariableAssignmentAST

class · Source (opens in a new tab)

class sun::ast::VariableAssignmentAST : public sun::ast::ExprAST

An assignment that replaces the value stored in a target expression.

Inherits

Public Functions

VariableAssignmentAST

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

sun::ast::VariableAssignmentAST::VariableAssignmentAST(std::string name, std::unique_ptr< ExprAST > value)

Creates this syntax node and takes ownership of any supplied child expressions.

Related: ExprAST

dotLabel

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

std::string sun::ast::VariableAssignmentAST::dotLabel() const override

Returns the node label used in syntax-tree graph visualizations.

forEachChildSlot

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

void sun::ast::VariableAssignmentAST::forEachChildSlot(const ChildSlotFn &fn) override

Visits replaceable child expressions so tree passes can rewrite them in place.

Related: ChildSlotFn

getName

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

const std::string & sun::ast::VariableAssignmentAST::getName() const

Returns the declared name used to identify this object.

getQualifiedName

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

const sun::semantic_analysis::QualifiedName & sun::ast::VariableAssignmentAST::getQualifiedName() const

Qualified name (after semantic analysis qualifies it).

A module-level global is emitted using its declaration ID, so codegen looks the symbol up by this rather than by the name written at the assignment.

Related: sun::semantic_analysis::QualifiedName

getType

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

ASTNodeType sun::ast::VariableAssignmentAST::getType() const override

Returns the syntax-node kind used to dispatch tree visitors.

Related: ASTNodeType

getValue

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

const ExprAST * sun::ast::VariableAssignmentAST::getValue() const

Returns the value represented by this object.

Related: ExprAST

setQualifiedName

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

void sun::ast::VariableAssignmentAST::setQualifiedName(sun::semantic_analysis::QualifiedName qname)

Records the declaration name together with its enclosing scopes.

Related: sun::semantic_analysis::QualifiedName

toString

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

std::string sun::ast::VariableAssignmentAST::toString() const override

Returns a readable representation for diagnostics and debugging.

Protected Functions

ensureAnalysis

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

void sun::ast::VariableAssignmentAST::ensureAnalysis() const override

Override to allocate VariableAnalysis instead of base ExprAnalysis.

Related: VariableAnalysis, ExprAnalysis

Private Functions

varAnalysis

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

VariableAnalysis & sun::ast::VariableAssignmentAST::varAnalysis() const

Accesses the variable assignment annotations used by later passes.

Related: VariableAnalysis

Private Fields

name

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

std::string sun::ast::VariableAssignmentAST::name

No documentation comment.

value

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

std::unique_ptr<ExprAST> sun::ast::VariableAssignmentAST::value

No documentation comment.

Related: ExprAST