P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
P4::DoExpandEmit Class Reference
Inheritance diagram for P4::DoExpandEmit:

Public Member Functions

 DoExpandEmit (ReferenceMap *refMap, TypeMap *typeMap)
 
bool expandArg (const IR::Type *type, const IR::Argument *argument, std::vector< const IR::Argument * > *result, std::vector< const IR::Type * > *resultTypes)
 
const IR::Node * postorder (IR::MethodCallStatement *statement) override
 

Detailed Description

Convert an emit of a struct recursively into a sequence of emits of all fields of the struct. Convert an emit of a header stack into a sequence of emits of all elements of the stack. header H1 {} header H2 {} struct S { H1 h1; H2[2] h2; } S s; packet.emit(s);

becomes

emit(s.h1); emit(s.h2[0]); emit(s.h2[1]);