18#ifndef MIDEND_FLATTENHEADERS_H_
19#define MIDEND_FLATTENHEADERS_H_
21#include "flattenInterfaceStructs.h"
22#include "frontends/p4/typeChecking/typeChecker.h"
37 : typeMap(typeMap), policy(policy) {
38 setName(
"FindHeaderTypesToReplace");
41 bool preorder(
const IR::Type_Header *type)
override;
44 return ::P4::get(replacement, name);
46 bool empty()
const {
return replacement.empty(); }
128 : typeMap(typeMap), findHeaderTypesToReplace(findHeaderTypesToReplace) {
130 CHECK_NULL(findHeaderTypesToReplace);
131 setName(
"ReplaceHeaders");
134 const IR::Node *preorder(IR::P4Program *program)
override;
135 const IR::Node *postorder(IR::Member *expression)
override;
136 const IR::Node *postorder(IR::Type_Header *type)
override;
144 passes.push_back(findHeadersToReplace);
145 passes.push_back(
new ReplaceHeaders(typeMap, findHeadersToReplace));
147 setName(
"FlattenHeaders");
Definition flattenInterfaceStructs.h:32
Definition typeChecker.h:32
Definition ir/pass_manager.h:40
Definition typeChecker.h:55
Definition ordered_map.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition flattenInterfaceStructs.h:69