P4C
The P4 Compiler
Loading...
Searching...
No Matches
checkConstants.h
1
/*
2
* Copyright 2017 VMware, Inc.
3
* SPDX-FileCopyrightText: 2017 VMware, Inc.
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
8
#ifndef FRONTENDS_P4_CHECKCONSTANTS_H_
9
#define FRONTENDS_P4_CHECKCONSTANTS_H_
10
11
#include "frontends/common/resolveReferences/resolveReferences.h"
12
#include "frontends/p4/typeChecking/typeChecker.h"
13
#include "ir/ir.h"
14
15
namespace
P4
{
16
20
class
DoCheckConstants :
public
Inspector
,
public
ResolutionContext {
21
TypeMap
*typeMap;
22
23
public
:
24
explicit
DoCheckConstants(
TypeMap
*typeMap) : typeMap(typeMap) {
25
CHECK_NULL(typeMap);
26
setName(
"DoCheckConstants"
);
27
}
28
29
void
postorder(
const
IR::MethodCallExpression *expr)
override
;
30
void
postorder(
const
IR::KeyElement *expr)
override
;
31
void
postorder(
const
IR::P4Table *table)
override
;
32
};
33
34
class
CheckConstants :
public
PassManager {
35
public
:
36
explicit
CheckConstants(
TypeMap
*typeMap) {
37
passes.push_back(
new
TypeChecking
(
nullptr
, typeMap));
38
passes.push_back(
new
DoCheckConstants
(typeMap));
39
setName(
"CheckConstants"
);
40
}
41
};
42
43
}
// namespace P4
44
45
#endif
/* FRONTENDS_P4_CHECKCONSTANTS_H_ */
P4::DoCheckConstants
Definition
checkConstants.h:20
P4::Inspector
Definition
visitor.h:418
P4::TypeChecking
Definition
typeChecker.h:55
P4::TypeMap
Definition
typeMap.h:32
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:13
frontends
p4
checkConstants.h
Generated by
1.13.2