-
Notifications
You must be signed in to change notification settings - Fork 444
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
[#4883] Remove unused actions whose @name
name starts with "__"
#4900
Conversation
Signed-off-by: Kyle Cripps <[email protected]>
@@ -112,7 +112,7 @@ const IR::Node *RemoveUnusedDeclarations::process(const IR::IDeclaration *decl) | |||
LOG3("Visiting " << decl); | |||
if (decl->getName().name == IR::ParserState::verify && getParent<IR::P4Program>()) | |||
return decl->getNode(); | |||
if (decl->getName().name.startsWith("__")) | |||
if (decl->externalName(decl->getName().name).startsWith("__")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when you have something like @name("a2") action _xyz()
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fruffy Please see the added test outputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tagging @oleg-ran-amd for any additional comments
Signed-off-by: Kyle Cripps <[email protected]>
@@ -0,0 +1,6 @@ | |||
issue4883_dup_has_returned_decl2.p4(34): [--Wwarn=uninitialized_use] warning: s.f may be uninitialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This seems like noise which can be fixed by initializing s, making it part of C2's parameters. Feel free to ignore this if required for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not remember if it is required for the test. @oleg-ran-amd If you think it's not required, feel free to push such changes to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this, but maybe clearing up the renaming behavior of inlining is the better long-term solution. Personally, I do not see why inlining should use the control-plane name.
@oleg-ran-amd Do you want to try this approach instead? If so, I will not merge this yet and allow you to push such changes to this branch (or open a new PR if you prefer that). |
Or I can just merge this now and let you make the better long-term changes later. Let me know what you prefer. |
@oleg-ran-amd From @asl:
|
Per DM with @oleg-ran-amd, I will merge this now and leave #4883 open for Oleg to look into the suggested better long-term solution later. |
…_" (p4lang#4900) * Remove unused actions whose external name starts with '__' Signed-off-by: Kyle Cripps <[email protected]> * Add additional test case Signed-off-by: Kyle Cripps <[email protected]> --------- Signed-off-by: Kyle Cripps <[email protected]>
Fixes #4883