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
15namespace P4 {
16
17class 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
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,
51
52 explicit MissingIdAssigner(
53 ReferenceMap *refMap, TypeMap *typeMap,
56};
57
62class AddMissingIdAnnotations final : public PassManager {
63 public:
64 AddMissingIdAnnotations(ReferenceMap *refMap, TypeMap *typeMap,
66};
67
68} // namespace P4
69
70#endif /* CONTROL_PLANE_ADDMISSINGIDS_H_ */
Definition p4RuntimeSymbolTable.h:84
Class used to encode maps from paths to declarations.
Definition referenceMap.h:67
Definition visitor.h:442
Definition typeMap.h:32
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13
Definition p4RuntimeArchHandler.h:195