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
9namespace P4 {
10// Removes assert and assume statements if it is not in debug mode
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
23class 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_ */
Definition removeAssertAssume.h:11
Definition node.h:95
Definition ir/pass_manager.h:40
Definition removeAssertAssume.h:23
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