19#ifndef BF_P4C_COMMON_HEADER_STACK_H_
20#define BF_P4C_COMMON_HEADER_STACK_H_
23#include "ir/pass_manager.h"
41 void postorder(IR::HeaderStack *stack)
override;
42 void postorder(IR::MAU::Primitive *primitive)
override;
43 void postorder(IR::BFN::Pipe *pipe)
override;
64 return Inspector::init_apply(root);
67 bool preorder(
const IR::BFN::Pipe *pipe)
override {
68 BUG_CHECK(pipe->headerStackInfo !=
nullptr,
69 "Running ElimUnusedHeaderStackInfo without running "
70 "CollectHeaderStackInfo first?");
71 stacks = pipe->headerStackInfo;
75 void postorder(
const IR::HeaderStack *stack)
override;
76 void end_apply()
override;
84 void postorder(IR::BFN::Pipe *pipe)
override;
117 friend struct ::CollectHeaderStackInfo;
118 friend class ::ElimUnusedHeaderStackInfo;
122 auto begin() const -> decltype(Values(info).begin()) {
return Values(
info).begin(); }
123 auto begin() ->
decltype(Values(info).begin()) {
return Values(info).begin(); }
124 auto end() const -> decltype(Values(info).end()) {
return Values(info).end(); }
125 auto end() ->
decltype(Values(info).end()) {
return Values(info).end(); }
126 auto at(
cstring n)
const ->
decltype(
info.at(n)) {
return info.at(n); }
128 auto count(
cstring n)
const ->
decltype(
info.count(n)) {
return info.count(n); }
130 if (
auto it =
info.find(n); it !=
info.end())
return &it->second;
149 IR::Node *preorder(IR::MAU::Action *act)
override;
164 IR::Node *preorder(IR::BFN::Pipe *pipe)
override;
168 IR::Node *postorder(IR::Member *member)
override;
179 IR::Node *postorder(IR::BFN::Extract *extract)
override;
Definition ir/pass_manager.h:40
Definition ordered_map.h:32
Definition ordered_set.h:32
Definition phv_fields.h:1095
Definition header_stack.h:148
Definition header_stack.h:160
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
@ Info
Take no action and continue compilation.
void info(const int kind, const char *format, const T *node, Args &&...args)
Report info messages of type kind. Requires that the node argument have source info.
Definition lib/error.h:148