1010#include " backends/p4tools/modules/p4rtsmith/core/target.h"
1111#include " backends/p4tools/modules/p4rtsmith/core/util.h"
1212#include " backends/p4tools/modules/p4rtsmith/register.h"
13+ #include " backends/p4tools/modules/p4rtsmith/toolname.h"
1314#include " control-plane/p4RuntimeSerializer.h"
1415#include " lib/error.h"
1516#include " lib/nullstream.h"
@@ -19,7 +20,7 @@ namespace P4Tools::RTSmith {
1920void RtSmith::registerTarget () {
2021 // Register all available compiler targets.
2122 // These are discovered by CMAKE, which fills out the register.h.in file.
22- registerCompilerTargets ();
23+ registerRtSmithTargets ();
2324}
2425
2526int RtSmith::mainImpl (const CompilerResult &compilerResult) {
@@ -104,9 +105,6 @@ int RtSmith::mainImpl(const CompilerResult &compilerResult) {
104105std::optional<RtSmithResult> generateConfigImpl (
105106 std::optional<std::reference_wrapper<const std::string>> program,
106107 const CompilerOptions &compilerOptions, const RtSmithOptions & /* rtSmithOptions*/ ) {
107- // Register supported compiler targets.
108- registerCompilerTargets ();
109-
110108 // Register supported P4RTSmith targets.
111109 registerRtSmithTargets ();
112110
@@ -121,12 +119,14 @@ std::optional<RtSmithResult> generateConfigImpl(
121119 if (program.has_value ()) {
122120 // Run the compiler to get an IR and invoke the tool.
123121 ASSIGN_OR_RETURN (compilerResult,
124- P4Tools::CompilerTarget::runCompiler (program.value ().get ()), std::nullopt );
122+ P4Tools::CompilerTarget::runCompiler (TOOL_NAME, program.value ().get ()),
123+ std::nullopt );
125124 } else {
126125 RETURN_IF_FALSE_WITH_MESSAGE (!compilerOptions.file .isNullOrEmpty (), std::nullopt ,
127126 ::error (" Expected a file input." ));
128127 // Run the compiler to get an IR and invoke the tool.
129- ASSIGN_OR_RETURN (compilerResult, P4Tools::CompilerTarget::runCompiler (), std::nullopt );
128+ ASSIGN_OR_RETURN (compilerResult, P4Tools::CompilerTarget::runCompiler (TOOL_NAME),
129+ std::nullopt );
130130 }
131131
132132 const auto *programInfo = RtSmithTarget::produceProgramInfo (compilerResult.value ());
0 commit comments