![]() |
P4C
The P4 Compiler
|
Encapsulates the details of invoking the P4 compiler for a target device and architecture. More...
#include <compiler_target.h>
Static Public Member Functions | |
static std::vector< const char * > * | initCompiler (std::string_view toolName, int argc, char **argv) |
static ICompileContext * | makeContext (std::string_view toolName) |
static CompilerResultOrError | runCompiler (const CompilerOptions &options, std::string_view toolName) |
static CompilerResultOrError | runCompiler (const CompilerOptions &options, std::string_view toolName, const std::string &source) |
![]() | |
static bool | init (std::string deviceName, std::string archName) |
static bool | setArch (std::string archName) |
static bool | setDevice (std::string deviceName) |
Protected Member Functions | |
CompilerTarget (std::string_view toolName, const std::string &deviceName, const std::string &archName) | |
virtual std::vector< const char * > * | initCompilerImpl (int argc, char **argv) const |
virtual ICompileContext * | makeContextImpl () const |
virtual P4::FrontEnd | mkFrontEnd () const |
A factory method for providing a target-specific front end implementation. | |
virtual MidEnd | mkMidEnd (const CompilerOptions &options) const |
A factory method for providing a target-specific mid end implementation. | |
virtual CompilerResultOrError | runCompilerImpl (const CompilerOptions &options, const IR::P4Program *) const |
const IR::P4Program * | runFrontend (const CompilerOptions &options, const IR::P4Program *program) const |
const IR::P4Program * | runMidEnd (const CompilerOptions &options, const IR::P4Program *program) const |
![]() | |
Target (std::string_view toolName, const std::string &deviceName, const std::string &archName) | |
Static Protected Member Functions | |
static const IR::P4Program * | runParser (const ParserOptions &options) |
![]() | |
template<class TargetImpl> | |
static const TargetImpl & | get (std::string_view toolName) |
Additional Inherited Members | |
![]() | |
virtual const IR::Expression * | createTargetUninitialized (const IR::Type *type, bool forceTaint) const |
![]() | |
Spec | spec |
The device and architecture supported by this instance. | |
std::string | toolName |
The name of the tool supported by this instance. | |
Encapsulates the details of invoking the P4 compiler for a target device and architecture.
|
static |
Initializes the P4 compiler with the given compiler-specific command-line arguments.
|
protectedvirtual |
This implementation just forwards the given arguments to the compiler.
|
static |
|
nodiscardprotectedvirtual |
|
static |
Runs the P4 compiler to produce an IR and various other kinds of information on the input program.
|
static |
Runs the P4 compiler to produce an IR and other information for the given source code.
|
protectedvirtual |
Reimplemented in P4::P4Tools::P4Testgen::TestgenTarget, and P4::Test::TestgenTarget.
|
protected |
Runs the front end of the P4 compiler on the given program.
|
protected |
Runs the mid end provided by @mkMidEnd on the given program.
|
staticprotected |
Parses the P4 program specified on the command line.