Skip to content

Commit

Permalink
Issue497 (#504)
Browse files Browse the repository at this point in the history
* Fix for issue #497

* Forgot to change the warning
  • Loading branch information
Mihai Budiu authored and antoninbas committed Apr 20, 2017
1 parent b2a075a commit c013c50
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions backends/bmv2/jsonconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,12 +1181,8 @@ Util::JsonArray* JsonConverter::createActions(Util::JsonArray* fieldLists,
jact->emplace("id", id);
auto params = mkArrayField(jact, "runtime_data");
for (auto p : *action->parameters->getEnumerator()) {
// The P4 v1.0 compiler removes unused action parameters!
// We have to do the same, although this seems wrong.
if (!refMap->isUsed(p)) {
::warning("Removing unused action parameter %1% for compatibility reasons", p);
continue;
}
if (!refMap->isUsed(p))
::warning("Unused action parameter %1%", p);

auto param = new Util::JsonObject();
param->emplace("name", p->name);
Expand Down

0 comments on commit c013c50

Please sign in to comment.