P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpf/midend.h
1/*
2 * SPDX-FileCopyrightText: 2013 Barefoot Networks, Inc.
3 * Copyright 2013-present Barefoot Networks, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef BACKENDS_EBPF_MIDEND_H_
9#define BACKENDS_EBPF_MIDEND_H_
10
11#include "ebpfOptions.h"
12#include "frontends/common/resolveReferences/referenceMap.h"
13#include "frontends/p4/typeMap.h"
14#include "ir/ir.h"
15
16namespace P4::EBPF {
17
18class MidEnd {
19 public:
20 std::vector<DebugHook> hooks;
21 P4::ReferenceMap refMap;
22 P4::TypeMap typeMap;
23
24 void addDebugHook(DebugHook hook) { hooks.push_back(hook); }
26 const IR::ToplevelBlock *run(EbpfOptions &options, const IR::P4Program *program,
27 std::ostream *outStream = nullptr);
28};
29
30} // namespace P4::EBPF
31
32#endif /* BACKENDS_EBPF_MIDEND_H_ */
Definition ebpf/midend.h:18
const IR::ToplevelBlock * run(EbpfOptions &options, const IR::P4Program *program, std::ostream *outStream=nullptr)
If p4c is run with option '–listMidendPasses', outStream is used for printing passes names.
Definition ebpf/midend.cpp:60
Definition ebpfOptions.h:17
Class used to encode maps from paths to declarations.
Definition referenceMap.h:58
Definition typeMap.h:32
Definition codeGen.cpp:14
std::function< void(const char *manager, unsigned seqNo, const char *pass, const IR::Node *node)> DebugHook
Definition ir/pass_manager.h:29