19#ifndef BF_P4C_ARCH_COLLECT_BRIDGED_FIELDS_H_
20#define BF_P4C_ARCH_COLLECT_BRIDGED_FIELDS_H_
25#include "ir/control_flow_visitor.h"
27#include "lib/cstring.h"
28#include "lib/ordered_map.h"
29#include "lib/ordered_set.h"
38using FieldRef = std::pair<cstring, cstring>;
42 const IR::Expression *refTemplate;
49 using TnaContext = std::pair<gress_t, const TnaParams &>;
58 std::set<FieldRef> fieldsToBridge;
65 void flow_merge(
Visitor &otherVisitor)
override;
66 void flow_copy(::ControlFlowVisitor &otherVisitor)
override;
68 std::optional<TnaContext> findTnaContext()
const;
69 bool analyzePathlikeExpression(
const IR::Expression *expr);
72 bool preorder(
const IR::P4Parser *)
override {
return false; }
73 bool preorder(
const IR::P4Control *)
override {
return false; }
74 bool preorder(
const IR::BFN::TnaControl *)
override;
75 bool preorder(
const IR::BFN::TnaParser *)
override;
76 bool preorder(
const IR::BFN::TnaDeparser *)
override;
77 bool preorder(
const IR::P4Table *)
override;
78 bool preorder(
const IR::Annotation *annot)
override;
79 bool preorder(
const IR::Member *member)
override;
80 bool preorder(
const IR::PathExpression *path)
override;
81 bool preorder(
const IR::MethodCallExpression *)
override;
82 void end_apply()
override;
85 void loop_revisit(
const IR::ParserState *)
override {}
86 void loop_revisit(
const IR::Declaration_Instance *)
override {}
94 static int uid_counter;
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition ordered_set.h:32
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
Definition collect_bridged_fields.h:40
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition collect_bridged_fields.h:47