17#ifndef BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
18#define BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
20#include "backends/bmv2/common/backend.h"
21#include "backends/common/programStructure.h"
23#include "lib/cstring.h"
36 unsigned scalars_width = 0;
37 unsigned bool_width = 1;
55 std::vector<const IR::ExternBlock *> globals;
59 : refMap(refMap), typeMap(typeMap) {
64 std::set<cstring> non_pipeline_controls;
65 std::set<cstring> pipeline_controls;
67 bool hasVisited(
const IR::Type_StructLike *st) {
68 if (
auto h = st->to<IR::Type_Header>())
69 return header_types.count(h->getName());
70 else if (
auto s = st->to<IR::Type_Struct>())
71 return metadata_types.count(s->getName());
72 else if (
auto u = st->to<IR::Type_HeaderUnion>())
73 return header_union_types.count(u->getName());
80 bool preorder(
const IR::ToplevelBlock *block)
override;
90 : refMap(refMap), typeMap(typeMap) {
95 bool isHeaders(
const IR::Type_StructLike *st);
Definition portableProgramStructure.h:83
Definition portableProgramStructure.h:78
Definition portableProgramStructure.h:28
ordered_map< cstring, const IR::Declaration_Variable * > scalars
Definition portableProgramStructure.h:35
Definition backends/common/programStructure.h:32
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition ordered_map.h:30
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24