P4C
The P4 Compiler
|
Functions | |
template<typename Func > | |
void | forAllEvaluatedBlocks (const IR::Block *block, Func function) |
std::optional< ExternInstance > | getExternInstanceFromProperty (const IR::P4Table *table, const cstring &propertyName, ReferenceMap *refMap, TypeMap *typeMap, bool *isConstructedInPlace) |
bool | isExternPropertyConstructedInPlace (const IR::P4Table *table, const cstring &propertyName) |
std::string | serializeOneAnnotation (const IR::Annotation *annotation) |
Serialize an unstructured @annotation to a string. | |
void | serializeOneStructuredAnnotation (const IR::Annotation *annotation, ::p4::config::v1::StructuredAnnotation *structuredAnnotation) |
Serialize a structured @annotation to the appropriate Protobuf message. | |
void | serializeOneStructuredAnnotation (const IR::Annotation *annotation, p4configv1::StructuredAnnotation *structuredAnnotation) |
void | serializeStructuredExpression (const IR::Expression *expr, p4configv1::Expression *sExpr) |
void | serializeStructuredKVPair (const IR::NamedExpression *kv, p4configv1::KeyValuePair *sKV) |
', '@id' and documentation annotations are ignored, as well as | |
Set all the fields in the @preamble, including the 'annotations' and 'doc' fields. ' annotations whose name satisfies predicate | |
int64_t | getTableSize (const IR::P4Table *table) |
template<typename UnaryPredicate > | |
void | setPreamble (::p4::config::v1::Preamble *preamble, p4rt_id_t id, cstring name, cstring alias, const IR::IAnnotated *annotated, UnaryPredicate p) |
void | setPreamble (::p4::config::v1::Preamble *preamble, p4rt_id_t id, cstring name, cstring alias, const IR::IAnnotated *annotated) |
template<typename Kind > | |
std::optional< Counterlike< Kind > > | getDirectCounterlike (const IR::P4Table *table, ReferenceMap *refMap, TypeMap *typeMap) |
', '@id' and documentation unstructured | |
Serialize @annotated's P4 annotations and attach them to a P4Info message with an 'annotations' and a 'structured_annotations" field. All structured annotations are included. ' annotations are ignored, as well as annotations whose name satisfies predicate | |
template<typename Message , typename UnaryPredicate > | |
void | addAnnotations (Message *message, const IR::IAnnotated *annotated, UnaryPredicate p) |
template<typename Message > | |
void | addAnnotations (Message *message, const IR::IAnnotated *annotated) |
calls addAnnotations with a unconditionally false predicate. | |
template<typename Message > | |
void | addDocumentation (Message *message, const IR::IAnnotated *annotated) |
' and '@description' annotations if present. | |
A collection of helper functions which can be used to implement P4RuntimeArchHandlerIface for different architectures.
struct P4::ControlPlaneAPI::Helpers::CounterlikeTraits |
A traits class describing the properties of "counterlike" things.
void P4::ControlPlaneAPI::Helpers::addDocumentation | ( | Message * | message, |
const IR::IAnnotated * | annotated ) |
' and '@description' annotations if present.
Set the 'doc' field for a P4Info message, using the '
void P4::ControlPlaneAPI::Helpers::forAllEvaluatedBlocks | ( | const IR::Block * | block, |
Func | function ) |
Visit evaluated blocks under the provided block. Guarantees that each block is visited only once, even if multiple paths to reach it exist.
std::optional< Counterlike< Kind > > P4::ControlPlaneAPI::Helpers::getDirectCounterlike | ( | const IR::P4Table * | table, |
ReferenceMap * | refMap, | ||
TypeMap * | typeMap ) |
std::optional< ExternInstance > P4::ControlPlaneAPI::Helpers::getExternInstanceFromProperty | ( | const IR::P4Table * | table, |
const cstring & | propertyName, | ||
ReferenceMap * | refMap, | ||
TypeMap * | typeMap, | ||
bool * | isConstructedInPlace = nullptr ) |
int64_t P4::ControlPlaneAPI::Helpers::getTableSize | ( | const IR::P4Table * | table | ) |
bool P4::ControlPlaneAPI::Helpers::isExternPropertyConstructedInPlace | ( | const IR::P4Table * | table, |
const cstring & | propertyName ) |