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
Make Type hierarchy methods const #10319
Conversation
Thanks for your pull request and interest in making D better, @edi33416! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#10319" |
The number of necessary |
I suggest you start with the leaf functions to avoid the need for |
{ | ||
return target.alignsize(this); | ||
return target.alignsize(cast() this); |
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.
You should update Target::alignsize
as receiving a const
parameter to avoid unnecessary cast.
{ | ||
return basetype.size(); | ||
return (cast() basetype).size(); |
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.
Why is this necessary? You're not making modifications here.
I agree. Especially since, as @jacob-carlborg pointed out:
I'll give |
|
You can try my tool DLP to identify leaf functions. https://github.com/jacob-carlborg/dlp |
I think that because the |
This PR is useful to the the C++ header generator to generate the dmd frontend header files that are used by
gdc
.For a detailed description of the motivation, please see PR