-
Notifications
You must be signed in to change notification settings - Fork 5
Changes to add itypes on undefined functions #691
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.
This looks good, though I had couple of comments.
Congratulations on getting more checked types in the tests.
Adds checks to ensure that 3C will not attempt to rewrite in unwritable files to insert array bounds. The test file in this PR contains an example using a function body in an unwritable file which fails on the current main. After changes made to support rewriting in functions declarations without definitions (#691), this will be able to happen even when the functions are not defined, and so it will becomes a more prevalent issue.
e7481b9
to
e0dbee0
Compare
f0f6fc0
to
4b90959
Compare
e0dbee0
to
5855166
Compare
5855166
to
c434414
Compare
The new behavior is now behind a flag. This now also depends on #692 |
This reverts part of commit e8f5ff5.
c434414
to
c019fe6
Compare
Fixes an assertion that would fail when attempting to extract the string representation of an itype expression from the original source code if the itype expression was inside a macro. The string representation for itypes in macros is now re-generated from the AST.
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.
The flag definition itself looks OK modulo my comment, but there have been so many merges and force-pushes since Kyle's approval that I can't claim to have reviewed the other changes you've made since then. Are we going to just trust that those changes are OK? Or if we want, I can try to construct the right diff to review.
The relevant changes should just be d589534...0ec32e0 The force-pushing can safely be ignored. |
Co-authored-by: Matt McCutchen (Correct Computation) <matt@correctcomputation.com>
Thanks. @kyleheadley I think it makes the most sense if you review these changes since you reviewed the previous version of the same code. |
In this block I see:
But it doesn't appear in the collective change. It's the only code from the block that I have any issue with. Was it perhaps reversed because of how github deals with diffs? Was this a real change and if so what is it for? |
This is undoing a change that was present in the original version of the 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.
One thing I noticed. I'm still hoping Kyle will review all the changes since his previous approval.
Also, please merge main
into this branch per our discussion. We expect that to make no difference, but it's good to rule out any surprises during the PR merge.
clang/lib/3C/ProgramInfo.cpp
Outdated
// If we've seen this symbol, but never seen a body for it, constrain | ||
// everything about it. |
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.
It seems this comment is no longer quite accurate when InferTypesForUndefs
is on.
Did I not do that in my previous comment? If there's some confusion about what needs to be reviewed, please send me a link, like was done above, or let me know that I'll need to look over the whole thing again. Otherwise, I'll stick with trusting that our team wants to have their code reviewed and has made their best effort to provide it. Since, as far I as recall, "submitter presses merge" and takes responsibility for their own code. |
My concern was that that discussion had not reached a conclusion (as could be expressed by a GitHub re-approval), not that there was confusion about what needed review. Maybe I should have said "approve" rather than "review". 🙂 |
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.
re-approve (code so far). Carry on.
With this change, 3C will insert itypes on functions without definitions. For example:
becomes
This should be merged into
main
after #690, #689, and #688.