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

Public Member Functions

 RemoveAliases (ReferenceMap *refMap, TypeMap *typeMap)
 
const IR::Node * postorder (IR::AssignmentStatement *statement) override
 
const IR::Node * postorder (IR::P4Control *control) override
 
const IR::Node * postorder (IR::P4Parser *parser) override
 

Detailed Description

Analyzes an assignment between structures. If the RHS expression refers to any of the fields in the LHS then it introduces an additional copy operation. For example: struct S { bit<32> a; bit<32> b; } S s; s = { s.b, s.a };

is replaced by:

S tmp; tmp = { s.b, s.a }; s = tmp;

Precondition
none
Postcondition
no structure assignment refers on the RHS to fields that appear in the LHS.