slang::ast::InstanceSymbol class final

Represents an instance of a module, interface, or program.

Base classes

class InstanceSymbolBase
Common functionality for module, interface, program, and primitive instances.

Public static functions

static InstanceSymbol& createDefault(Compilation& compilation, const DefinitionSymbol& definition, const HierarchyOverrideNode* hierarchyOverrideNode = nullptr, const ConfigBlockSymbol* configBlock = nullptr, const ConfigRule* configRule = nullptr, SourceLocation locationOverride = {})
Creates a default-instantiated instance of the given definition.
static InstanceSymbol& createVirtual(const ASTContext& context, SourceLocation loc, const DefinitionSymbol& definition, const syntax::ParameterValueAssignmentSyntax* paramAssignments)
Creates a placeholder instance for a virtual interface type declaration.
static Symbol& createDefaultNested(const Scope& scope, const syntax::ModuleDeclarationSyntax& syntax)
Creates a default-instantiated instance of a nested definition in the provided scope.
static InstanceSymbol& createInvalid(Compilation& compilation, const DefinitionSymbol& definition)
Creates an intentionally invalid instance by forcing all parameters to null values.

Public functions

const InstanceBodySymbol* getCanonicalBody() const
If it has been determined that the body of this instance is an exact duplicate of another, this returns a pointer to the canonical copy to avoid duplicating effort visiting this instance's body again.

Public variables

const ResolvedConfig* resolvedConfig
A config rule that applies to this instance, or a pointer to the parent instance's config rule if there is one up the stack.

Function documentation

static InstanceSymbol& slang::ast::InstanceSymbol::createDefault(Compilation& compilation, const DefinitionSymbol& definition, const HierarchyOverrideNode* hierarchyOverrideNode = nullptr, const ConfigBlockSymbol* configBlock = nullptr, const ConfigRule* configRule = nullptr, SourceLocation locationOverride = {})

Creates a default-instantiated instance of the given definition.

All parameters must have defaults specified.

static InstanceSymbol& slang::ast::InstanceSymbol::createInvalid(Compilation& compilation, const DefinitionSymbol& 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.

const InstanceBodySymbol* slang::ast::InstanceSymbol::getCanonicalBody() const

If it has been determined that the body of this instance is an exact duplicate of another, this returns a pointer to the canonical copy to avoid duplicating effort visiting this instance's body again.

Otherwise returns nullptr.