P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4tools/common/compiler/midend.h
1#ifndef BACKENDS_P4TOOLS_COMMON_COMPILER_MIDEND_H_
2#define BACKENDS_P4TOOLS_COMMON_COMPILER_MIDEND_H_
3
4#include "frontends/common/options.h"
5#include "frontends/common/resolveReferences/referenceMap.h"
6#include "frontends/p4/typeMap.h"
7#include "ir/ir.h"
8#include "ir/pass_manager.h"
9#include "ir/visitor.h"
10#include "midend/convertEnums.h"
11#include "midend/convertErrors.h"
12
13namespace P4::P4Tools {
14
24class MidEnd : public PassManager {
25 protected:
26 P4::ReferenceMap refMap;
27 P4::TypeMap typeMap;
28
32 virtual Visitor *mkConvertEnums();
33
37 virtual Visitor *mkConvertErrors();
38
40 virtual Visitor *mkConvertKeys();
41
45
49
54 virtual bool localCopyPropPolicy(const Visitor::Context *ctx, const IR::Expression *expr);
55
56 public:
57 explicit MidEnd(const CompilerOptions &);
58
61
64
67 virtual void addDefaultPasses();
68
71 virtual void addNonTypeCheckingPasses();
72};
73
74} // namespace P4::P4Tools
75
76#endif /* BACKENDS_P4TOOLS_COMMON_COMPILER_MIDEND_H_ */
Definition convertEnums.h:29
Definition convertErrors.h:39
Definition frontends/common/options.h:30
Definition p4tools/common/compiler/midend.h:24
P4::TypeMap * getTypeMap()
Retrieve the type map used in the mid end.
Definition p4tools/common/compiler/midend.cpp:87
virtual Visitor * mkConvertKeys()
Provides a target-specific pass that simplifies keys in table calls under a custom policy.
Definition p4tools/common/compiler/midend.cpp:54
virtual Visitor * mkConvertEnums()
Definition p4tools/common/compiler/midend.cpp:48
virtual P4::ChooseErrorRepresentation * mkConvertErrorPolicy()
Definition p4tools/common/compiler/midend.cpp:69
virtual Visitor * mkConvertErrors()
Definition p4tools/common/compiler/midend.cpp:50
virtual P4::ChooseEnumRepresentation * mkConvertEnumsPolicy()
Definition p4tools/common/compiler/midend.cpp:58
virtual void addNonTypeCheckingPasses()
Definition p4tools/common/compiler/midend.cpp:165
P4::ReferenceMap * getRefMap()
Retrieve the reference map used in the mid end.
Definition p4tools/common/compiler/midend.cpp:85
virtual void addDefaultPasses()
Definition p4tools/common/compiler/midend.cpp:89
virtual bool localCopyPropPolicy(const Visitor::Context *ctx, const IR::Expression *expr)
Definition p4tools/common/compiler/midend.cpp:80
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeMap.h:41
Definition visitor.h:75
Definition common/compiler/compiler_result.cpp:3
Definition visitor.h:47