17#ifndef BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
18#define BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
20#include "backends/common/programStructure.h"
21#include "frontends/common/resolveReferences/referenceMap.h"
22#include "frontends/p4/typeMap.h"
24#include "lib/cstring.h"
37 unsigned scalars_width = 0;
38 unsigned bool_width = 1;
56 std::vector<const IR::ExternBlock *> globals;
60 : refMap(refMap), typeMap(typeMap) {
65 std::set<cstring> non_pipeline_controls;
66 std::set<cstring> pipeline_controls;
68 bool hasVisited(
const IR::Type_StructLike *st) {
69 if (
auto h = st->to<IR::Type_Header>())
70 return header_types.count(h->getName());
71 else if (
auto s = st->to<IR::Type_Struct>())
72 return metadata_types.count(s->getName());
73 else if (
auto u = st->to<IR::Type_HeaderUnion>())
74 return header_union_types.count(u->getName());
81 bool preorder(
const IR::ToplevelBlock *block)
override;
91 : refMap(refMap), typeMap(typeMap) {
96 bool isHeaders(
const IR::Type_StructLike *st);
Definition portableProgramStructure.h:84
Definition portableProgramStructure.h:79
Definition portableProgramStructure.h:29
ordered_map< cstring, const IR::Declaration_Variable * > scalars
Definition portableProgramStructure.h:36
Definition backends/common/programStructure.h:32
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition ordered_map.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24