slang::InstanceSymbol class

Base class for module, interface, and program instance symbols.

Base classes

class Symbol

Public static functions

static auto createDefault(Compilation& compilation, const Definition& definition, const flat_hash_map<string_view, const ConstantValue*>* paramOverrides = nullptr) -> InstanceSymbol&
static auto createInvalid(Compilation& compilation, const Definition& definition) -> InstanceSymbol&

Public functions

auto getArrayName() const -> string_view
void getArrayDimensions(SmallVector<ConstantRange>& dimensions) const

Function documentation

static InstanceSymbol& slang::InstanceSymbol::createDefault(Compilation& compilation, const Definition& definition, const flat_hash_map<string_view, const ConstantValue*>* paramOverrides = nullptr)

Creates a default-instantiated instance of the given definition. All parameters must have defaults specified.

static InstanceSymbol& slang::InstanceSymbol::createInvalid(Compilation& compilation, const Definition& definition)

Creates an intentionally invalid instance by forcing all parameters to null values. This allows type checking instance members as long as they don't depend on any parameters.

string_view slang::InstanceSymbol::getArrayName() const

If this instance is part of an array, walk upward to find the array's name. Otherwise returns the name of the instance itself.

void slang::InstanceSymbol::getArrayDimensions(SmallVector<ConstantRange>& dimensions) const

Gets the set of dimensions describing the instance array that contains this instance. If this instance is not part of an array, does not add any dimensions to the given list.