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
7
namespace
P4
{
8
14
class
DoReplaceTypedef
final :
public
Transform
,
public
ResolutionContext
{
15
public
:
16
DoReplaceTypedef
() =
default
;
17
const
IR::Type *preorder(IR::Type_Name *type)
override
;
18
};
19
20
class
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_ */
P4::ClearTypeMap
Definition
typeChecker.h:32
P4::DoReplaceTypedef
Definition
eliminateTypedefs.h:14
P4::EliminateTypedef
Definition
eliminateTypedefs.h:20
P4::PassManager
Definition
ir/pass_manager.h:40
P4::ResolutionContext
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Definition
resolveReferences.h:35
P4::Transform
Definition
visitor.h:424
P4::TypeChecking
Definition
typeChecker.h:55
P4::TypeMap
Definition
typeMap.h:41
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:24
midend
eliminateTypedefs.h
Generated by
1.12.0