P4C
The P4 Compiler
Loading...
Searching...
No Matches
eliminateTypedefs.h
1#ifndef MIDEND_ELIMINATETYPEDEFS_H_
2#define MIDEND_ELIMINATETYPEDEFS_H_
3
4#include "frontends/common/resolveReferences/resolveReferences.h"
5#include "frontends/p4/typeChecking/typeChecker.h"
6
7namespace P4 {
8
14class DoReplaceTypedef final : public Transform, public ResolutionContext {
15 public:
16 DoReplaceTypedef() = default;
17 const IR::Type *preorder(IR::Type_Name *type) override;
18};
19
20class EliminateTypedef final : public PassManager {
21 public:
22 EliminateTypedef(TypeMap *typeMap, TypeChecking *typeChecking = nullptr) {
23 if (!typeChecking) typeChecking = new TypeChecking(nullptr, typeMap);
24 passes.push_back(typeChecking);
25 passes.push_back(new DoReplaceTypedef);
26 passes.push_back(new TypeChecking(nullptr, typeMap, true));
27 passes.push_back(new ClearTypeMap(typeMap));
28 setName("EliminateTypedefs");
29 }
30};
31
32} // namespace P4
33
34#endif /* MIDEND_ELIMINATETYPEDEFS_H_ */
Definition typeChecker.h:32
Definition eliminateTypedefs.h:14
Definition eliminateTypedefs.h:20
Definition ir/pass_manager.h:40
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Definition resolveReferences.h:35
Definition visitor.h:424
Definition typeChecker.h:55
Definition typeMap.h:41
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24