P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::BMV2::CFG Class Referencefinal

#include <controlFlowGraph.h>

Inheritance diagram for P4::BMV2::CFG:
[legend]

Classes

class  DummyNode
 
class  Edge
 A CFG Edge; can be an in-edge or out-edge. More...
 
class  EdgeSet
 
class  IfNode
 
class  Node
 
class  TableNode
 

Public Member Functions

void build (const IR::P4Control *cc, P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
 
bool checkImplementable () const
 
void computeSuccessors ()
 
void dbprint (std::ostream &out) const
 
void dbprint (std::ostream &out, Node *node, std::set< Node * > &done) const
 
NodemakeNode (const IR::IfStatement *statement)
 
NodemakeNode (const IR::P4Table *table, const IR::Expression *invocation)
 
NodemakeNode (cstring name)
 
void setEntry (Node *entry)
 
- Public Member Functions inherited from P4::IHasDbPrint
void print () const
 

Public Attributes

ordered_set< Node * > allNodes
 
const IR::P4Control * container
 
NodeentryPoint
 
NodeexitPoint
 

Protected Types

enum class  EdgeType { Unconditional , True , False , Label }
 

Detailed Description

This CFG models the BMV2 notion of control-flow graph. In BMv2 there are only 2 types of nodes: If and Table.

Member Function Documentation

◆ checkImplementable()

bool P4::BMV2::CFG::checkImplementable ( ) const

BMv2 is very restricted in the kinds of graphs it supports. Thie method checks whether a CFG is implementable.

◆ dbprint()

void P4::BMV2::CFG::dbprint ( std::ostream & out) const
virtual

Implements P4::IHasDbPrint.