P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::AllocContext Class Reference

Represents a PHV-allocation context: a parser, a table, or a deparser. More...

#include <phv_fields.h>

Public Types

enum class  Type { PARSER , TABLE , DEPARSER }
 

Public Member Functions

bool is_deparser () const
 
bool is_parser () const
 
bool is_table () const
 
cstring typeStr () const
 

Static Public Member Functions

static const AllocContextof_unit (const IR::BFN::Unit *unit)
 

Public Attributes

const IR::MAU::Table * table
 Populated iff type is TABLE.
 
Type type
 

Static Public Attributes

static const AllocContextDEPARSER
 
static const AllocContextPARSER
 

Detailed Description

Represents a PHV-allocation context: a parser, a table, or a deparser.

Member Function Documentation

◆ of_unit()

static const AllocContext * PHV::AllocContext::of_unit ( const IR::BFN::Unit * unit)
inlinestatic

Factory method for producing an AllocContext from a Unit.

Parameters
unitis expected to be a parser, a deparser, or a table. Anything else is a compiler bug.

Member Data Documentation

◆ DEPARSER

const PHV::AllocContext * PHV::AllocContext::DEPARSER
static
Initial value:
=
new PHV::AllocContext(AllocContext::Type::DEPARSER)
Represents a PHV-allocation context: a parser, a table, or a deparser.
Definition phv_fields.h:83

◆ PARSER

const PHV::AllocContext * PHV::AllocContext::PARSER
static
Initial value:
=
new PHV::AllocContext(AllocContext::Type::PARSER)