P4C
The P4 Compiler
|
#include <externInstance.h>
Static Public Member Functions | |
static std::optional< ExternInstance > | resolve (const IR::Expression *expr, ReferenceMap *refMap, TypeMap *typeMap, const std::optional< cstring > &defaultName=std::nullopt) |
static std::optional< ExternInstance > | resolve (const IR::PathExpression *path, ReferenceMap *refMap, TypeMap *typeMap) |
if it has external information about what the name should be. | |
Anonymous instances do not have a name, but the caller may provide one via | |
static std::optional< ExternInstance > | resolve (const IR::ConstructorCallExpression *constructorCallExpr, ReferenceMap *refMap, TypeMap *typeMap, const std::optional< cstring > &name=std::nullopt) |
Public Attributes | |
const IR::IAnnotated * | annotations |
const IR::Vector< IR::Argument > * | arguments |
const IR::Expression * | expression |
const std::optional< cstring > | name |
ParameterSubstitution | substitution |
const IR::Type_Extern * | type |
const IR::Vector< IR::Type > * | typeArguments |
ExternInstance is a utility class that allows you to gather information about an expression that resolves to an extern instance.
The name is in analogy to MethodInstance. It provides information about the name of the extern instance, the underlying extern type, the arguments it was instantiated with, and the annotations that we applied to it. It can gather this information from either a reference to a named instance, or from an expression which constructs an anonymous instance.
|
static |
@expr may either refer to a named extern instance (i.e., it may be a PathExpression), or it may construct an anonymous instance directly (i.e., it may be a ConstructorCallExpression). In the latter case, the instance will not have a name; @defaultName may optionally be used to specify a default name to return.
|
static |