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

Public Member Functions

 DoRemoveActionParameters (ActionInvocation *invocations)
 
ActionInvocationgetInvocations ()
 
const IR::Node * postorder (IR::ActionListElement *element) override
 
const IR::Node * postorder (IR::MethodCallExpression *expression) override
 
const IR::Node * postorder (IR::P4Action *table) override
 

Detailed Description

Removes parameters of an action which are in/inout/out.

control c(inout bit<32> x) {
action a(in bit<32> arg) { x = arg; }
table t() { actions = { a(10); } }
apply { ... } }

is converted to

control c(inout bit<32> x) {
bit<32> arg;
action a() { arg = 10; x = arg; }
table t() { actions = { a; } }
apply { ... } }
Precondition
This pass requires each action to have a single caller. It must run after the LocalizeActions pass, which in turn must be run after actions inlining. It also run after UniqueParameters pass.
Postcondition
in/inout/out parameters of an action are removed.