19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_DEPARSE_GRAPH_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_DEPARSE_GRAPH_H_
22#include "bf-p4c/lib/boost_graph.h"
23#include "bf-p4c/phv/phv_fields.h"
27enum vertex_deparse_graph_t { vertex_deparse_graph };
28BOOST_INSTALL_PROPERTY(vertex, deparse_graph);
43 bool isConstant()
const {
return constant; }
44 bool isField()
const {
return field; }
51 BUG_CHECK(
constant,
"Created a deparse graph node with a null constant");
55 BUG_CHECK(
field,
"Created a deparse graph node with a null field");
60 typedef boost::adjacency_list<boost::vecS, boost::vecS,
61 boost::bidirectionalS,
67 using Node =
typename Graph::vertex_descriptor;
74 Node
addConst(
const IR::Constant *c);
77 bool addEdge(Node src, Node dst);
95 std::map<const PHV::Field *, Node> fieldToVertex;
Definition deparse_graph.h:34
bool canReach(const PHV::Field *f1, const PHV::Field *f2) const
Determines whether f1 might be deparsed before f2.
Definition deparse_graph.cpp:53
const std::vector< NodeInfo > nodesBetween(const PHV::Field *f1, const PHV::Field *f2) const
Definition deparse_graph.cpp:63
Node addField(const PHV::Field *f)
Definition deparse_graph.cpp:21
bool addEdge(Node src, Node dst)
Adds an edge from src to dst.
Definition deparse_graph.cpp:34
Node addConst(const IR::Constant *c)
Definition deparse_graph.cpp:29
Definition ordered_set.h:32
Definition phv_fields.h:154
Definition boost_graph.h:39
Definition table_flow_graph.h:33
Definition deparse_graph.h:36
const PHV::Field * field
Non-null if this node represents the deparsing of a field.
Definition deparse_graph.h:41
const IR::Constant * constant
Non-null if this node represents the deparsing of a constant.
Definition deparse_graph.h:38