sun::ast::GenericCallAST

sun::ast::GenericCallAST

class · Source (opens in a new tab)

class sun::ast::GenericCallAST : public sun::ast::ExprAST

Generic function call: create<Type>(args...) or create<Type1, Type2>(args...) Used for generic free functions like create<T>, destroy, etc.

Inherits

Public Functions

GenericCallAST

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

sun::ast::GenericCallAST::GenericCallAST(std::string name, std::vector< std::unique_ptr< TypeAnnotation > > typeArgs, std::vector< std::unique_ptr< ExprAST > > arguments)

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

Related: TypeAnnotation, ExprAST

dotLabel

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

std::string sun::ast::GenericCallAST::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::GenericCallAST::forEachChildSlot(const ChildSlotFn &fn) override

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

Related: ChildSlotFn

getArgConversions

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

const std::vector< sun::semantic_analysis::ArgConversion > & sun::ast::GenericCallAST::getArgConversions() const

Returns the argument conversions selected by analysis.

Related: sun::semantic_analysis::ArgConversion

getArgs

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

const std::vector< std::unique_ptr< ExprAST > > & sun::ast::GenericCallAST::getArgs() const

Provides the ordered arguments associated with this expression.

Related: ExprAST

getArgsMutable

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

std::vector< std::unique_ptr< ExprAST > > & sun::ast::GenericCallAST::getArgsMutable()

Mutable access to the argument list (used to expand variadic packs into concrete args during semantic analysis).

Related: ExprAST

getFunctionName

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

const std::string & sun::ast::GenericCallAST::getFunctionName() const

Returns the function name stored by this object.

getGenericFunctionAST

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

const FunctionAST * sun::ast::GenericCallAST::getGenericFunctionAST() const

Returns the generic function syntax tree stored by this object.

Related: FunctionAST

getResolvedCalleeType

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

TypePtr sun::ast::GenericCallAST::getResolvedCalleeType() const

Return the concrete callable signature, or null in an abstract template.

Related: TypePtr

getResolvedTypeArgs

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

const std::vector< TypePtr > & sun::ast::GenericCallAST::getResolvedTypeArgs() const

Returns the concrete generic type arguments.

Related: TypePtr

getType

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

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

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

Related: ASTNodeType

getTypeArguments

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

const std::vector< std::unique_ptr< TypeAnnotation > > & sun::ast::GenericCallAST::getTypeArguments() const

Provides the concrete types supplied for generic specialization.

Related: TypeAnnotation

hasGenericFunctionAST

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

bool sun::ast::GenericCallAST::hasGenericFunctionAST() const

Reports whether this object has generic function syntax tree.

hasResolvedTypeArgs

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

bool sun::ast::GenericCallAST::hasResolvedTypeArgs() const

Reports whether this object has resolved type args.

setArgConversions

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

void sun::ast::GenericCallAST::setArgConversions(std::vector< sun::semantic_analysis::ArgConversion > conversions) const

Resolved type arguments (set by semantic analyzer after type param substitution) How each argument reaches its parameter (set by the semantic analyzer once the specialization is known; one entry per argument).

Related: sun::semantic_analysis::ArgConversion

setGenericFunctionAST

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

void sun::ast::GenericCallAST::setGenericFunctionAST(const FunctionAST *ast) const

Generic function AST (set by semantic analyzer).

Related: FunctionAST

setResolvedCalleeType

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

void sun::ast::GenericCallAST::setResolvedCalleeType(TypePtr type) const

Record the instantiated callable signature used to check this call.

Related: TypePtr

setResolvedTypeArgs

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

void sun::ast::GenericCallAST::setResolvedTypeArgs(std::vector< TypePtr > types) const

Updates the concrete generic type arguments.

Related: TypePtr

toString

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

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

Override to allocate GenericCallAnalysis instead of base ExprAnalysis.

Related: GenericCallAnalysis, ExprAnalysis

Private Functions

gcAnalysis

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

GenericCallAnalysis & sun::ast::GenericCallAST::gcAnalysis() const

Access as GenericCallAnalysis.

Related: GenericCallAnalysis

Private Fields

args

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

std::vector<std::unique_ptr<ExprAST> > sun::ast::GenericCallAST::args

No documentation comment.

Related: ExprAST

functionName

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

std::string sun::ast::GenericCallAST::functionName

No documentation comment.

typeArguments

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

std::vector<std::unique_ptr<TypeAnnotation> > sun::ast::GenericCallAST::typeArguments

No documentation comment.

Related: TypeAnnotation