sun::ast::VariableAssignmentAST
class · Source (opens in a new tab)
class sun::ast::VariableAssignmentAST : public sun::ast::ExprASTAn assignment that replaces the value stored in a target expression.
Inherits
- sun::ast::ExprAST (public)
Public Functions
- VariableAssignmentAST
- dotLabel
- forEachChildSlot
- getName
- getQualifiedName
- getType
- getValue
- setQualifiedName
- toString
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 overrideReturns 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) overrideVisits 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() constReturns 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() constQualified 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 overrideReturns 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() constReturns 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 overrideReturns a readable representation for diagnostics and debugging.
Protected Functions
ensureAnalysis
protected · function · Source (opens in a new tab)
void sun::ast::VariableAssignmentAST::ensureAnalysis() const overrideOverride 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() constAccesses 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::nameNo documentation comment.
value
private · variable · Source (opens in a new tab)
std::unique_ptr<ExprAST> sun::ast::VariableAssignmentAST::valueNo documentation comment.
Related: ExprAST