Skip to content

Commit

Permalink
Fix P4Dummy Backend Failure with External Input Program (#2)
Browse files Browse the repository at this point in the history
* Fix P4Dummy Backend Failure with External Input Program

Fixes #1

* updated patch
  • Loading branch information
snapdgn committed Mar 16, 2024
1 parent 868f59c commit 4eccbfa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,16 @@ V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main;)";
int main(int argc, char *const argv[]) {
AutoCompileContext autoP4DummyContext(new P4Dummy::P4DummyContext);
auto &options = P4Dummy::P4DummyContext::get().options();
options.langVersion = CompilerOptions::FrontendVersion::P4_16;

if (options.process(argc, argv) == nullptr) {
return EXIT_FAILURE;
}

const IR::P4Program *program = nullptr;
if (options.file == nullptr && !options.useFixed) {
options.usage();
return EXIT_FAILURE;
if (!options.useFixed) {
options.setInputFile();
}

const IR::P4Program *program = nullptr;
if (options.useFixed) {
program = P4Dummy::parseDummyP4(options);
} else {
Expand Down

0 comments on commit 4eccbfa

Please sign in to comment.