sun::ast::IfExprAST

sun::ast::IfExprAST

class · Source (opens in a new tab)

class sun::ast::IfExprAST : public sun::ast::ExprAST

A conditional expression with a condition and alternative branches.

Inherits

Public Functions

IfExprAST

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

sun::ast::IfExprAST::IfExprAST(std::unique_ptr< ExprAST > Cond, std::unique_ptr< ExprAST > Then, std::unique_ptr< ExprAST > Else)

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::IfExprAST::dotLabel() const override

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

elseSlot

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

std::unique_ptr< ExprAST > & sun::ast::IfExprAST::elseSlot()

Provides the replaceable slot for the alternative branch.

Related: ExprAST

forEachChildSlot

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

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

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

Related: ChildSlotFn

getCond

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

ExprAST * sun::ast::IfExprAST::getCond() const

Returns the condition expression.

Related: ExprAST

getElse

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

ExprAST * sun::ast::IfExprAST::getElse() const

Returns the alternative branch.

Related: ExprAST

getThen

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

ExprAST * sun::ast::IfExprAST::getThen() const

Returns the branch taken when the condition is true.

Related: ExprAST

getType

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

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

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

Related: ASTNodeType

thenSlot

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

std::unique_ptr< ExprAST > & sun::ast::IfExprAST::thenSlot()

Mutable body slots for LoweringPass block normalization.

Related: ExprAST

toString

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

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

Returns a readable representation for diagnostics and debugging.

Private Fields

Cond

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

std::unique_ptr<ExprAST> sun::ast::IfExprAST::Cond

No documentation comment.

Related: ExprAST

Else

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

std::unique_ptr<ExprAST> sun::ast::IfExprAST::Else

No documentation comment.

Related: ExprAST

Then

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

std::unique_ptr<ExprAST> sun::ast::IfExprAST::Then

No documentation comment.

Related: ExprAST