P4C
The P4 Compiler
|
#include <flattenInterfaceStructs.h>
Public Member Functions | |
StructTypeReplacement (const P4::TypeMap *typeMap, const IR::Type_StructLike *type, AnnotationSelectionPolicy *policy) | |
virtual void | dbprint (std::ostream &out) const |
const IR::StructExpression * | explode (const IR::Expression *root, cstring prefix) |
void | flatten (const P4::TypeMap *typeMap, cstring prefix, const IR::Type *type, const IR::Vector< IR::Annotation > &annotations, IR::IndexedVector< IR::StructField > &fields, AnnotationSelectionPolicy *policy) |
Public Member Functions inherited from P4::IHasDbPrint | |
void | print () const |
Public Attributes | |
std::map< cstring, cstring > | fieldNameRemap |
const IR::Type * | replacementType |
std::map< cstring, const IR::Type_StructLike * > | structFieldMap |
Describes how a nested struct type is replaced: the new type to replace it and how each field is renamed. For example, consider the following:
struct S { bit a; bool b; }
struct T { S s; bit<6> y; }
struct M { T t; bit<3> x; }
|
inlinevirtual |
Implements P4::IHasDbPrint.
|
inline |
Returns a StructExpression suitable for initializing a struct for the fields that start with the given prefix. For example, for prefix .t and root R this returns { .s = { .a = R._t_s_a0, .b = R._t_s_b1 }, .y = R._t_y2 }