Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[p4fmt]: Add a pretty printer for p4fmt. #4862

Merged
merged 17 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backends/p4fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ set(FMT_SRCS
p4fmt.cpp
options.cpp
main.cpp
p4formatter.cpp
)

set(REFCHECK_SRCS
refcheck.cpp
options.cpp
p4fmt.cpp
p4formatter.cpp
)

# p4fmt
Expand Down
4 changes: 2 additions & 2 deletions backends/p4fmt/p4fmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "frontends/common/parseInput.h"
#include "frontends/common/parser_options.h"
#include "frontends/p4/toP4/toP4.h"
#include "ir/ir.h"
#include "lib/compile_context.h"
#include "lib/error.h"
#include "options.h"
#include "p4formatter.h"

namespace P4::P4Fmt {

Expand All @@ -24,7 +24,7 @@ std::stringstream getFormattedOutput(std::filesystem::path inputFile) {
return formattedOutput;
}

auto top4 = P4::ToP4(&formattedOutput, false);
auto top4 = P4Fmt::P4Formatter(&formattedOutput);
// Print the program before running front end passes.
program->apply(top4);

Expand Down
Loading
Loading