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

Classes

struct  Pair
 A pair of expression representing an expression and a mask. More...
 

Public Member Functions

 DoSingleArgumentSelect (TypeMap *typeMap)
 
void checkExpressionType (const IR::Expression *expression)
 
bool preorder (IR::SelectCase *selCase) override
 
bool preorder (IR::SelectExpression *expression) override
 

Detailed Description

Converts select(a, b, c) into select(a ++ b ++ c) &&& (maska ++ maskb ++ maskc). A similar transformation is done for the labels.

Precondition
This should be run after SimplifySelectList and RemoveSelectBooleans. It assumes that all select arguments are scalar values of type Type_Bits.