P4C
The P4 Compiler
Loading...
Searching...
No Matches
annotate_with_in_hash.h
1
54#ifndef BACKENDS_TOFINO_BF_P4C_MIDEND_ANNOTATE_WITH_IN_HASH_H_
55#define BACKENDS_TOFINO_BF_P4C_MIDEND_ANNOTATE_WITH_IN_HASH_H_
56
57#include "bf-p4c/midend/type_checker.h"
58#include "ir/ir.h"
59
60namespace BFN {
61
66 P4::TypeMap *typeMap;
67
68 bool checkKeyDefaultAction(const IR::P4Control &control, const IR::P4Action &action) const;
69 bool checkAssignmentStructure(const IR::AssignmentStatement &assignment,
70 const IR::Expression **op, const IR::Expression **opConcat);
71 bool checkAluSuitability(const IR::Expression &op) const;
72 bool checkHeaderMetadataReference(const IR::Expression &op) const;
73
74 public:
75 explicit DoAnnotateWithInHash(P4::TypeMap *typeMap) : typeMap(typeMap) {}
76 const IR::Node *preorder(IR::BlockStatement *b) override;
77 const IR::Node *preorder(IR::Expression *e) override;
78 const IR::Node *preorder(IR::AssignmentStatement *assignment) override;
79};
80
88 public:
90 BFN::TypeChecking *typeChecking = nullptr) {
91 if (!typeChecking) typeChecking = new BFN::TypeChecking(refMap, typeMap);
92 passes.push_back(typeChecking);
93 passes.push_back(new DoAnnotateWithInHash(typeMap));
94 }
95};
96
97} // namespace BFN
98
99#endif // BACKENDS_TOFINO_BF_P4C_MIDEND_ANNOTATE_WITH_IN_HASH_H_
Definition node.h:95
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition visitor.h:424
Definition typeChecker.h:55
Definition typeMap.h:41
const IR::Node * preorder(IR::BlockStatement *b) override
Definition midend/annotate_with_in_hash.cpp:177
Top level PassManager that governs annotation of specific assignment statements with the @in_hash ann...
Definition annotate_with_in_hash.h:87
Definition annotate_with_in_hash.h:65
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21