-
Notifications
You must be signed in to change notification settings - Fork 5
Insert itypes correctly for constant sized arrays #702
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
Conversation
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'd be curious if the other I'm now satisfied that this isn't the case. I thought the mkString
change in #657 interacts in some way with what you are trying to achieve here and might indicate that a different approach might be preferable for this PR. Maybe one of us can look into that later.int [10] foo : itype(int _Checked[10])
problem might be related to the change I made to processing of arrays in mkString
, but it sounds like that problem actually arises from the order of operations in DeclRewriter::buildItypeDecl
.
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.
"Request changes" just to make sure you consider my (not fully investigated) idea about getRewritableOriginalTy
. We can dismiss my review if we determine that idea won't work.
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.
Looks good to me. mkString remains a complicated function but we don't know the way around that and that's not the point of this pr
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.
Thanks for figuring out the qtyToStr
thing! I'm glad that there was a functionality benefit (as well as a design benefit) to offset the extra work. It's probably possible to clean up more of the getRewritableOriginalTy
-related code now, but that's outside the scope of this PR; I may file a follow-up issue later.
The parts of this PR that I understand (:slightly_smiling_face:) look good to me, modulo the following comments. But I assume Aaron has reviewed the other parts.
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.
Two more nits. Thanks for your patience.
Co-authored-by: Matt McCutchen (Correct Computation) <[email protected]>
This fixes a rewriting error observed in libjpeg.
Given this declaration converted with
3c -itypes-for-extern -alltypes
The output incorrectly moved the length before the identifier.
A similar issue can be observed without
-itypes-for-extern
Which converted to a valid declaration, but the array type declaration was transformed into a pointer.
These examples now correctly rewrite to itypes
int foo[10] : itype(int _Checked[10])
.