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

Use IR::Annotation::nameAnnotation everywhere instead of hard-coding @name annotation name #4628

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

kfcripps
Copy link
Contributor

No description provided.

@kfcripps kfcripps requested a review from asl April 18, 2024 00:49
@kfcripps kfcripps marked this pull request as draft April 18, 2024 01:56
@@ -32,7 +32,7 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
}
}

@my_anno_5 @my_anno_3 control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
@my_anno_5 @my_anno_3 @name("MyIngress.inner_ctrl") control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have test output change here?

Copy link
Contributor Author

@kfcripps kfcripps Apr 18, 2024

Choose a reason for hiding this comment

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

@asl Apparently, we can't reference IR::Annotation::nameAnnotation in a static container initializer list:

// set of annotations to _not_ propagate during inlining
std::set<cstring> Inline::noPropagateAnnotations = {"name"};

so it must remain hard-coded here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, order of static initializers in different TUs is not quite defined.

@kfcripps kfcripps marked this pull request as ready for review April 18, 2024 02:36
@kfcripps kfcripps requested a review from asl April 18, 2024 02:36
@fruffy fruffy added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Apr 18, 2024
@kfcripps kfcripps added this pull request to the merge queue Apr 18, 2024
Merged via the queue into p4lang:main with commit 6e20abe Apr 18, 2024
17 checks passed
@kfcripps kfcripps deleted the no-hardcode-name-annotation branch April 18, 2024 14:58
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants