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

P4C-DPDK - Support Non-zero arguments for default action #3206

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

github-sajan
Copy link
Contributor

No description provided.

@github-sajan github-sajan force-pushed the non-zero-arg-def-action branch 2 times, most recently from 7d83448 to 8fb256b Compare April 11, 2022 14:21
BUG_CHECK(mi->is<P4::ActionCall>(),
"%1%: expected action in default_action", default_action);
auto new_l = new IR::IndexedVector<IR::Parameter>;
for (auto p : mi->to<P4::ActionCall>()->action->parameters->parameters) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't you just keep a pointer to the list itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

backends/dpdk/dpdkArch.h Show resolved Hide resolved
if (earg->is<IR::ListExpression>()) {
auto paramCount = earg->to<IR::ListExpression>()->components.size();
for (unsigned i = 0; i < paramCount; i++) {
if (earg->to<IR::ListExpression>()->components.at(i)->is<IR::Constant>()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if the argument is not a numeric constant what should happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@github-sajan github-sajan force-pushed the non-zero-arg-def-action branch from 8fb256b to 48889bc Compare April 21, 2022 14:55
@github-sajan github-sajan force-pushed the non-zero-arg-def-action branch from 48889bc to 9aaa5f4 Compare April 21, 2022 15:13
@github-sajan github-sajan requested a review from mihaibudiu April 21, 2022 15:16
@mihaibudiu mihaibudiu merged commit 42410db into p4lang:main Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants