sun::ast::ReturnExprAST

sun::ast::ReturnExprAST

class · Source (opens in a new tab)

class sun::ast::ReturnExprAST : public sun::ast::ExprAST

Return statement: return <expr>;.

Inherits

Public Functions

ReturnExprAST

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

sun::ast::ReturnExprAST::ReturnExprAST(std::unique_ptr< ExprAST > value=nullptr)

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::ReturnExprAST::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::ReturnExprAST::forEachChildSlot(const ChildSlotFn &fn) override

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

Related: ChildSlotFn

getTargetType

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

sun::types::TypePtr sun::ast::ReturnExprAST::getTargetType() const

Returns the declared return type recorded by semantic analysis.

Related: sun::types::TypePtr

getType

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

ASTNodeType sun::ast::ReturnExprAST::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::ReturnExprAST::getValue() const

Returns the value represented by this object.

Related: ExprAST

hasValue

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

bool sun::ast::ReturnExprAST::hasValue() const

Reports whether this object has value.

setTargetType

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

void sun::ast::ReturnExprAST::setTargetType(sun::types::TypePtr type)

Records the declared return type used to lower ownership conversions.

Related: sun::types::TypePtr

toString

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

std::string sun::ast::ReturnExprAST::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::ReturnExprAST::ensureAnalysis() const override

Allocates return-specific metadata when analysis first needs it.

Private Fields

Value

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

std::unique_ptr<ExprAST> sun::ast::ReturnExprAST::Value

No documentation comment.

Related: ExprAST