-
Notifications
You must be signed in to change notification settings - Fork 446
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
Typedef annotations is not generated correctly #4914
Comments
This is probably the eliminate typedefs or eliminate new type pass. Both of them are simple and this can be fixed. Are you able to submit a PR for this? |
Are you also expecting that such annotations on
If you are only expecting them to copy over to fields in header type definitions, why not the others? If you are expecting them to copy over to all places that a I think there are also cases where a compiler pass can create new variables with types that are copied from existing variables. If so, would you expect that the annotations be copied from the existing variable to the new variable in such cases? |
I believe the annotations should be copied everywhere wherever "typedef" is replaced, otherwise we are losing information. |
Makes sense, and that does seem like a good goal to me. I mainly wanted to warn you that besides the one pass that replaces |
@komaljai or anyone else looking at this issue: Is your goal to generate P4Info files where table key fields, action parameters, and/or other kinds of things represented in a P4Info file, have annotations on them that are "inherited" from annotations on the If so, note that p4c's P4Info generation is after the last front-end pass, and before the first mid-end pass, and the pass that removes If you want annotations on (a) modify the P4Info generation code to look up the or perhaps both (a) and (b) might be required. For (a), note that this issue and some of its code snippets and discussion in comments might be useful in finding a solution: #2310 |
This should translate to
Compiler should copy annotations for 'typedef' (which is not currently supported)
The text was updated successfully, but these errors were encountered: