8#ifndef BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
9#define BACKENDS_COMMON_PORTABLEPROGRAMSTRUCTURE_H_
11#include "backends/common/programStructure.h"
12#include "frontends/common/resolveReferences/referenceMap.h"
13#include "frontends/p4/typeMap.h"
15#include "lib/cstring.h"
28 unsigned scalars_width = 0;
29 unsigned bool_width = 1;
47 std::vector<const IR::ExternBlock *> globals;
51 : refMap(refMap), typeMap(typeMap) {
56 std::set<cstring> non_pipeline_controls;
57 std::set<cstring> pipeline_controls;
59 bool hasVisited(
const IR::Type_StructLike *st) {
60 if (
auto h = st->to<IR::Type_Header>())
61 return header_types.count(h->getName());
62 else if (
auto s = st->to<IR::Type_Struct>())
63 return metadata_types.count(s->getName());
64 else if (
auto u = st->to<IR::Type_HeaderUnion>())
65 return header_union_types.count(u->getName());
72 bool preorder(
const IR::ToplevelBlock *block)
override;
82 : refMap(refMap), typeMap(typeMap) {
87 bool isHeaders(
const IR::Type_StructLike *st);
Definition portableProgramStructure.h:70
ordered_map< cstring, const IR::Declaration_Variable * > scalars
Definition portableProgramStructure.h:27
Definition backends/common/programStructure.h:23
Class used to encode maps from paths to declarations.
Definition referenceMap.h:67
Definition ordered_map.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13