-
Notifications
You must be signed in to change notification settings - Fork 284
dump-c: when removing const-ness, also handle bit fields #5672
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
We need to remove the const qualifier when the assignment is no longer performed as part of the declaration. This worked for various types already, but bit fields had not been considered.
6569098 to
72f5736
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5672 +/- ##
========================================
Coverage 69.44% 69.45%
========================================
Files 1243 1243
Lines 100612 100614 +2
========================================
+ Hits 69875 69886 +11
+ Misses 30737 30728 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
martin-cs
left a comment
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 the test cases esp.!
| cat "${name}-mod.gb" | ||
| mv "${name}.gb" "${name}-mod.gb" | ||
| elif echo $args | grep -q -- "--dump-c" ; then | ||
| cat "${name}-mod.gb" |
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.
Is this going to cause issues with other tests / increase the amount of output drastically?
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.
Since this output is only generated when --dump-c is included in the test options, I think only very few cases (with small source files) will be affected. Thus, we should be fine.
| const p | ||
| -- | ||
| This test demonstrates that the constness of struct members has been removed, | ||
| which is necessary as the initialisation is not performed in the declaration. |
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 guess this is just one of those unavoidable things as we split an initialisation into DECL and ASSIGN instructions.
We need to remove the const qualifier when the assignment is no longer
performed as part of the declaration. This worked for various types
already, but bit fields had not been considered.