P4C
The P4 Compiler
Loading...
Searching...
No Matches
entryPriorities.h
1
/*
2
Copyright 2023 Mihai Budiu
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#ifndef FRONTENDS_P4_ENTRYPRIORITIES_H_
18
#define FRONTENDS_P4_ENTRYPRIORITIES_H_
19
20
#include "coreLibrary.h"
21
#include "frontends/common/resolveReferences/resolveReferences.h"
22
#include "ir/ir.h"
23
#include "ir/pass_manager.h"
24
25
namespace
P4
{
26
28
class
DoEntryPriorities
:
public
Transform {
29
ReferenceMap
*refMap;
30
P4::P4CoreLibrary
&corelib;
31
32
bool
requiresPriority(
const
IR::KeyElement *ke)
const
;
33
34
public
:
35
explicit
DoEntryPriorities
(
ReferenceMap
*refMap)
36
: refMap(refMap), corelib(P4::P4CoreLibrary::instance()) {
37
setName(
"DoEntryPriorities"
);
38
CHECK_NULL(refMap);
39
}
40
const
IR::Node *preorder(IR::EntriesList *entries)
override
;
41
};
42
43
class
EntryPriorities
:
public
PassManager {
44
public
:
45
explicit
EntryPriorities
(
ReferenceMap
*refMap) {
46
setName(
"EntryPriorities"
);
47
passes.emplace_back(
new
ResolveReferences
(refMap));
48
passes.emplace_back(
new
DoEntryPriorities
(refMap));
49
}
50
};
51
52
}
// namespace P4
53
54
#endif
/* FRONTENDS_P4_ENTRYPRIORITIES_H_ */
P4::DoEntryPriorities
Assigns priorities to table entries if they are not 'const'.
Definition
entryPriorities.h:28
P4::EntryPriorities
Definition
entryPriorities.h:43
P4::P4CoreLibrary
Definition
coreLibrary.h:100
P4::ReferenceMap
Class used to encode maps from paths to declarations.
Definition
referenceMap.h:66
P4::ResolveReferences
Definition
resolveReferences.h:119
P4
Definition
applyOptionsPragmas.cpp:24
frontends
p4
entryPriorities.h
Generated on Tue Mar 26 2024 for