P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
compiler_target.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_COMPILER_TARGET_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_COMPILER_TARGET_H_
3
4#include "backends/p4tools/common/compiler/compiler_target.h"
5#include "backends/p4tools/common/compiler/reachability.h"
6#include "midend/coverage.h"
7
8namespace P4Tools::P4Testgen {
9
12 private:
14 P4::Coverage::CoverageSet coverableNodes;
15
17 const NodesCallGraph *callGraph;
18
19 public:
20 explicit TestgenCompilerResult(CompilerResult compilerResult,
21 P4::Coverage::CoverageSet coverableNodes,
22 const NodesCallGraph *callGraph = nullptr);
23
27 [[nodiscard]] const NodesCallGraph &getCallGraph() const;
28
30 [[nodiscard]] const P4::Coverage::CoverageSet &getCoverableNodes() const;
31
32 DECLARE_TYPEINFO(TestgenCompilerResult, CompilerResult);
33};
34
36 protected:
37 explicit TestgenCompilerTarget(std::string deviceName, std::string archName);
38
39 private:
40 CompilerResultOrError runCompilerImpl(const IR::P4Program *program) const override;
41};
42
43} // namespace P4Tools::P4Testgen
44
45#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_COMPILER_TARGET_H_ */
Definition compiler_target.h:21
Encapsulates the details of invoking the P4 compiler for a target device and architecture.
Definition compiler_target.h:41
Definition reachability.h:27
Extends the CompilerResult with the associated P4RuntimeApi.
Definition compiler_target.h:11
const P4::Coverage::CoverageSet & getCoverableNodes() const
Definition compiler_target.cpp:24
const NodesCallGraph & getCallGraph() const
Definition compiler_target.cpp:19
Definition compiler_target.h:35
std::set< const IR::Node *, SourceIdCmp > CoverageSet
Definition coverage.h:39
std::optional< std::reference_wrapper< const CompilerResult > > CompilerResultOrError
Definition compiler_target.h:38