P4C
The P4 Compiler
Loading...
Searching...
No Matches
tc/midend.h
1/*
2 * Copyright (C) 2023 Intel Corporation
3 * SPDX-FileCopyrightText: 2023 Intel Corporation
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef BACKENDS_TC_MIDEND_H_
9#define BACKENDS_TC_MIDEND_H_
10
11#include "backends/ebpf/lower.h"
12#include "frontends/common/constantFolding.h"
13#include "frontends/common/options.h"
14#include "frontends/common/resolveReferences/referenceMap.h"
15#include "frontends/common/resolveReferences/resolveReferences.h"
16#include "frontends/p4/evaluator/evaluator.h"
17#include "frontends/p4/moveDeclarations.h"
18#include "frontends/p4/simplify.h"
19#include "frontends/p4/simplifyParsers.h"
20#include "frontends/p4/strengthReduction.h"
21#include "frontends/p4/toP4/toP4.h"
22#include "frontends/p4/typeChecking/typeChecker.h"
23#include "frontends/p4/typeMap.h"
24#include "frontends/p4/unusedDeclarations.h"
25#include "ir/ir.h"
26#include "midend/actionSynthesis.h"
27#include "midend/complexComparison.h"
28#include "midend/convertEnums.h"
29#include "midend/copyStructures.h"
30#include "midend/eliminateInvalidHeaders.h"
31#include "midend/eliminateNewtype.h"
32#include "midend/eliminateSerEnums.h"
33#include "midend/eliminateTuples.h"
34#include "midend/expandEmit.h"
35#include "midend/local_copyprop.h"
36#include "midend/midEndLast.h"
37#include "midend/noMatch.h"
38#include "midend/parserUnroll.h"
39#include "midend/removeExits.h"
40#include "midend/removeLeftSlices.h"
41#include "midend/removeMiss.h"
42#include "midend/removeSelectBooleans.h"
43#include "midend/simplifyKey.h"
44#include "midend/simplifySelectCases.h"
45#include "midend/simplifySelectList.h"
46#include "midend/singleArgumentSelect.h"
47#include "midend/tableHit.h"
48#include "midend/validateProperties.h"
49#include "options.h"
50
51namespace P4::TC {
52
53class MidEnd {
54 public:
55 std::vector<DebugHook> hooks;
56 P4::ReferenceMap refMap;
57 P4::TypeMap typeMap;
58
59 void addDebugHook(DebugHook hook) { hooks.push_back(hook); }
60 // If p4c is run with option '--listMidendPasses', outStream is used for printing passes names
61 IR::ToplevelBlock *run(TCOptions &options, const IR::P4Program *program,
62 std::ostream *outStream = nullptr);
63};
64} // namespace P4::TC
65
66#endif /* BACKENDS_TC_MIDEND_H_ */
Class used to encode maps from paths to declarations.
Definition referenceMap.h:67
Definition tc/midend.h:53
Definition backends/tc/options.h:16
Definition typeMap.h:32
This file defines functions for the pass to generate the introspection file.
Definition tc/backend.cpp:17
std::function< void(const char *manager, unsigned seqNo, const char *pass, const IR::Node *node)> DebugHook
Definition ir/pass_manager.h:38