P4C
The P4 Compiler
Loading...
Searching...
No Matches
addMissingIds.h
1
/*
2
* SPDX-FileCopyrightText: 2022 The P4 Language Consortium
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef CONTROL_PLANE_ADDMISSINGIDS_H_
8
#define CONTROL_PLANE_ADDMISSINGIDS_H_
9
10
#include "frontends/common/resolveReferences/resolveReferences.h"
11
#include "frontends/p4/typeChecking/typeChecker.h"
12
#include "ir/ir.h"
13
#include "p4RuntimeSymbolTable.h"
14
15
namespace
P4
{
16
17
class
MissingIdAssigner :
public
Transform
{
20
ReferenceMap
*refMap;
21
26
TypeMap
*typeMap;
27
29
static
constexpr
int
ID_BIT_WIDTH = 32;
30
34
const
ControlPlaneAPI::P4RuntimeSymbolTable
*symbols =
nullptr
;
35
38
const
ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface
&archBuilder;
39
40
const
IR::P4Program *preorder(IR::P4Program *program)
override
;
41
const
IR::Property *postorder(IR::Property *property)
override
;
42
const
IR::P4Table *postorder(IR::P4Table *table)
override
;
43
const
IR::Type_Header *postorder(IR::Type_Header *hdr)
override
;
44
const
IR::P4ValueSet *postorder(IR::P4ValueSet *valueSet)
override
;
45
const
IR::P4Action *postorder(IR::P4Action *action)
override
;
46
47
public
:
48
explicit
MissingIdAssigner(
49
ReferenceMap
*refMap,
TypeMap
*typeMap,
50
const
ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface
&archBuilder);
51
52
explicit
MissingIdAssigner(
53
ReferenceMap
*refMap,
TypeMap
*typeMap,
54
const
ControlPlaneAPI::P4RuntimeSymbolTable
*symbols,
55
const
ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface
&archBuilder);
56
};
57
62
class
AddMissingIdAnnotations final :
public
PassManager {
63
public
:
64
AddMissingIdAnnotations(
ReferenceMap
*refMap,
TypeMap
*typeMap,
65
const
ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface
*archBuilder);
66
};
67
68
}
// namespace P4
69
70
#endif
/* CONTROL_PLANE_ADDMISSINGIDS_H_ */
P4::ControlPlaneAPI::P4RuntimeSymbolTable
Definition
p4RuntimeSymbolTable.h:84
P4::ReferenceMap
Class used to encode maps from paths to declarations.
Definition
referenceMap.h:67
P4::Transform
Definition
visitor.h:442
P4::TypeMap
Definition
typeMap.h:32
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:13
P4::ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface
Definition
p4RuntimeArchHandler.h:195
control-plane
addMissingIds.h
Generated by
1.13.2