P4C
The P4 Compiler
Loading...
Searching...
No Matches
type_checker.h
1
19#ifndef BF_P4C_MIDEND_TYPE_CHECKER_H_
20#define BF_P4C_MIDEND_TYPE_CHECKER_H_
21
22#include "frontends/common/resolveReferences/resolveReferences.h"
23#include "frontends/p4/evaluator/evaluator.h"
24#include "frontends/p4/typeChecking/typeChecker.h"
25
26namespace BFN {
27
34 P4::TypeMap *typeMap;
35
36 public:
37 explicit TypeInference(P4::TypeMap *typeMap, bool readOnly = false)
38 : P4::TypeInference(typeMap, readOnly), typeMap(typeMap) {}
39
40 const IR::Node *postorder(IR::BFN::ReinterpretCast *) override;
41 const IR::Node *postorder(IR::BFN::SignExtend *) override;
42 const IR::Node *postorder(IR::Member *) override;
43 TypeInference *clone() const override;
44
45 protected:
46 const IR::Type *setTypeType(const IR::Type *type, bool learn = true) override;
47};
48
56 public:
57 TypeChecking(P4::ReferenceMap *refMap, P4::TypeMap *typeMap, bool updateExpressions = false);
58};
59
66class EvaluatorPass final : public PassManager, public P4::IHasBlock {
67 P4::Evaluator *evaluator;
68
69 public:
70 IR::ToplevelBlock *getToplevelBlock() const override { return evaluator->getToplevelBlock(); }
72};
73
74} // namespace BFN
75
76#endif /* BF_P4C_MIDEND_TYPE_CHECKER_H_ */
Definition evaluator.h:33
Definition evaluator.h:115
Definition evaluator.h:28
Definition node.h:94
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeChecker.h:55
Definition typeChecker.h:483
Definition typeMap.h:41
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21