P4C
The P4 Compiler
Loading...
Searching...
No Matches
removeAssertAssume.h
1
#ifndef MIDEND_REMOVEASSERTASSUME_H_
2
#define MIDEND_REMOVEASSERTASSUME_H_
3
4
#include "frontends/common/resolveReferences/resolveReferences.h"
5
#include "frontends/p4/typeChecking/typeChecker.h"
6
#include "frontends/p4/typeMap.h"
7
#include "ir/ir.h"
8
9
namespace
P4
{
10
// Removes assert and assume statements if it is not in debug mode
11
class
DoRemoveAssertAssume
:
public
Transform
,
public
ResolutionContext
{
12
P4::TypeMap
*typeMap;
13
14
public
:
15
explicit
DoRemoveAssertAssume
(
P4::TypeMap
*typeMap) : typeMap(typeMap) {
16
CHECK_NULL(typeMap);
17
setName(
"DoRemoveAssertAssume"
);
18
}
19
20
const
IR::Node
*preorder(IR::MethodCallStatement *statement)
override
;
21
};
22
23
class
RemoveAssertAssume
final :
public
PassManager
{
24
public
:
25
explicit
RemoveAssertAssume
(
TypeMap
*typeMap,
TypeChecking
*typeChecking =
nullptr
) {
26
if
(!typeChecking) typeChecking =
new
TypeChecking
(
nullptr
, typeMap);
27
passes.push_back(typeChecking);
28
passes.push_back(
new
DoRemoveAssertAssume
(typeMap));
29
setName(
"RemoveAssertAssume"
);
30
}
31
};
32
33
}
// namespace P4
34
35
#endif
/* MIDEND_REMOVEASSERTASSUME_H_ */
P4::DoRemoveAssertAssume
Definition
removeAssertAssume.h:11
P4::IR::Node
Definition
node.h:95
P4::PassManager
Definition
ir/pass_manager.h:40
P4::RemoveAssertAssume
Definition
removeAssertAssume.h:23
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
removeAssertAssume.h
Generated by
1.12.0