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

Add Vector::dbprint #4943

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Add Vector::dbprint #4943

merged 2 commits into from
Oct 7, 2024

Conversation

vlstill
Copy link
Contributor

@vlstill vlstill commented Oct 4, 2024

IR::Vector and IR::IndexedVector are often used in other IR nodes (such us BlockStatement or P4Control), and therefore is often processed by passes. However, up until now it had only un-useful default debug printer. This PR adds simple debug printer for indexed vector. It is mainly useful in debugger, in tests to add context to failed assertion, or in LOG* functions.

@vlstill vlstill force-pushed the vstill/ivector-dbprint branch from d85b5bf to 4d87566 Compare October 4, 2024 08:29
@vlstill vlstill added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Oct 4, 2024
@vlstill vlstill changed the title Add IndexedVector::dbprint Add Vector::dbprint Oct 4, 2024
@vlstill vlstill force-pushed the vstill/ivector-dbprint branch from 2021965 to bd90dbe Compare October 4, 2024 14:30
@fruffy
Copy link
Collaborator

fruffy commented Oct 4, 2024

The STF failures come from the comment not being escaped properly because the generated string has a newline and STF does not support multi-line comments. It would be nice to fix this. The current workaround is to remove newlines for writing there:
https://github.com/p4lang/p4c/blob/main/backends/p4tools/common/lib/trace_event_types.cpp#L68

@vlstill vlstill added the run-validation Use this tag to trigger a Validation CI run. label Oct 7, 2024
@vlstill vlstill force-pushed the vstill/ivector-dbprint branch from c989de7 to b6648dc Compare October 7, 2024 10:29
Signed-off-by: Vladimír Štill <vladimir.still@intel.com>
@vlstill vlstill force-pushed the vstill/ivector-dbprint branch 2 times, most recently from 4d07e85 to 7661bb5 Compare October 7, 2024 16:42
Signed-off-by: Vladimír Štill <git@vstill.eu>
@vlstill vlstill marked this pull request as ready for review October 7, 2024 16:43
@vlstill vlstill requested review from asl and fruffy October 7, 2024 16:43
Copy link
Contributor

@asl asl left a comment

Choose a reason for hiding this comment

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

Looks reasonable

@vlstill vlstill enabled auto-merge October 7, 2024 17:03
@vlstill vlstill added this pull request to the merge queue Oct 7, 2024
Merged via the queue into main with commit 7c6d2b8 Oct 7, 2024
19 checks passed
@vlstill vlstill deleted the vstill/ivector-dbprint branch October 7, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Topics concerning the core segments of the compiler (frontend, midend, parser) run-validation Use this tag to trigger a Validation CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants