-
-
Notifications
You must be signed in to change notification settings - Fork 273
Add the @ldc.attributes.weak linkage attribute for global symbols. #1378
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
d426ece to
b91eeab
Compare
|
I am using this in Weka's LDC compiler to speed up a unittest build testcase by ~12%. edit: marking druntime functions as @weak and enabling https://github.com/D-Programming-Language/dmd/blob/master/src/root/rmem.d#L166-L193 |
tests/ir/lit.site.cfg.in
Outdated
| # subdirectories contain auxiliary inputs for various tests in their parent | ||
| # directories. | ||
| config.excludes = [] | ||
| config.excludes = ['Input'] |
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.
Shouldn't this be Inputs for consistency with LLVM (especially since the comment says so)? If we deviate from that, I would suggest going with a lower-case name to match the D conventions (input).
|
What you could do is to just have a |
I think I tried that, but then the logic has to be changed I think. (it's no longer a StructExpression) |
|
Either way works out fine. One might be a bit prettier, but the other is easier to implement. Your choice. ;) |
|
Well... one is already implemented.... ;) |
| return true; | ||
| } | ||
|
|
||
| bool isFromLdcAttibutes(const StructLiteralExp *e) { |
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.
Where is the new overload used?
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.
At the moment, it's not used anywhere but here. It was a refactoring to allow checking of other types of ldc.attributes. I kept it for future use convenience / easier reading of code.
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.
My critique would be that isFromLdcAttributes should really be isLdcAttributes for the ModuleDeclaration overload then, since the module is not "from" itself.
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, changing it.
|
Perhaps "for consistency" |
|
I prefer just having |
|
I've made |
|
The druntime change = ldc-developers/druntime@ldc-ltsmaster...weaklink |
|
Feel free to merge once this passes. |
|
@klickverbot Thanks for your comments. |
|
(recommitted to correctly trigger CI) |
Implements #1376 .
I did not know how to best implement a UDA syntax
@weakwithout using astruct _weakandalias weak = _weak(). I thought@weak()would be ugly, but I have no strong opinion on this. Please advise on naming :)