slang::ast::CallExpression class final

Represents a subroutine call.

Base classes

class Expression
The base class for all expressions in SystemVerilog.

Public types

struct IteratorCallInfo
Extra information associated with an iterator method call.
struct RandomizeCallInfo
Extra information associated with a randomize method call.
struct SystemCallInfo
Additional context that applies to system subroutine calls.

Public functions

const Expression* thisClass() const
If this call is for a class method, returns the expression representing the class handle on which the method is being invoked.
std::span<const Expression*const> arguments() const
std::span<const Expression*> arguments()
bool isSystemCall() const
std::string_view getSubroutineName() const
SubroutineKind getSubroutineKind() const
parsing::KnownSystemName getKnownSystemName() const
bool hasOutputArgs() const

Public variables

Subroutine subroutine
The subroutine that is being called.
const ClassType* classQualifier
If the called method was named via the class scope resolution operator (e.g.

Function documentation

const Expression* slang::ast::CallExpression::thisClass() const

If this call is for a class method, returns the expression representing the class handle on which the method is being invoked.

Otherwise returns nullptr.

std::span<const Expression*const> slang::ast::CallExpression::arguments() const

Returns the arguments to the call.

std::span<const Expression*> slang::ast::CallExpression::arguments()

Returns the arguments to the call.

bool slang::ast::CallExpression::isSystemCall() const

Returns true if this is a call of a system subroutine.

std::string_view slang::ast::CallExpression::getSubroutineName() const

Returns the name of the subroutine being called.

SubroutineKind slang::ast::CallExpression::getSubroutineKind() const

Returns the kind of subroutine being called.

parsing::KnownSystemName slang::ast::CallExpression::getKnownSystemName() const

Returns the known system name for the subroutine, if it's a built-in subroutine.

bool slang::ast::CallExpression::hasOutputArgs() const

Returns true if the called subroutine has output (or inout / ref) arguments.

Variable documentation

const ClassType* slang::ast::CallExpression::classQualifier

If the called method was named via the class scope resolution operator (e.g.

Base::f()) or the 'super' handle (e.g. super.f()), this is the class whose scope was named; otherwise nullptr. Note that this can differ from the class that declares the method if the method is inherited.

For virtual methods this determines how the call is dispatched: a call qualified by a base class of the calling class invokes that class's implementation directly, while an unqualified call dispatches based on the dynamic type of the object. Tools disagree on whether qualifying a call with the calling class itself dispatches or not.