P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::ActionSynthesisPolicy Class Referenceabstract

#include <actionSynthesis.h>

Inheritance diagram for P4::ActionSynthesisPolicy:
[legend]

Public Member Functions

virtual bool can_combine (const Visitor::Context *, const IR::BlockStatement *, const IR::StatOrDecl *)
 
virtual bool convert (const Visitor::Context *ctxt, const IR::P4Control *control)=0
 

Detailed Description

Policy which selects the control blocks where action synthesis is applied.

Member Function Documentation

◆ can_combine()

virtual bool P4::ActionSynthesisPolicy::can_combine ( const Visitor::Context * ,
const IR::BlockStatement * ,
const IR::StatOrDecl *  )
inlinevirtual

Called for each statement that may be put into an action when there are preceeding statements already put into an action –

Parameters
ctxtcontext of the code being processsed (control and parents)
blkprevious statement(s) being put into an action
stmtstatement to be added to the block for a single action
Returns
true statement should be added to the same action false statement should start a new action

◆ convert()

virtual bool P4::ActionSynthesisPolicy::convert ( const Visitor::Context * ctxt,
const IR::P4Control * control )
pure virtual

If the policy returns true the control block is processed, otherwise it is left unchanged.

Implemented in P4::BMV2::SkipControls, and P4::P4Test::SkipControls.