24#ifndef BF_P4C_MIDEND_REWRITE_FLEXIBLE_HEADER_H_
25#define BF_P4C_MIDEND_REWRITE_FLEXIBLE_HEADER_H_
27#include "frontends/p4/typeMap.h"
43 const IR::Node *postorder(IR::Type_Struct *st)
override {
44 if (st->getAnnotation(
"flexible"_cs) ==
nullptr)
return st;
47 for (
auto f : st->fields) {
48 fields.push_back(
new IR::StructField(
49 f->name, {new IR::Annotation(IR::ID(
"flexible"), {})}, f->type));
52 return new IR::Type_Struct(st->name, st->annotations, fields);
Definition typeChecker.h:32
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeChecker.h:55
Top level PassManager that governs moving of flexible annotation from structure to its fields.
Definition rewrite_flexible_header.h:61
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