Since these are only ever run once, they can be marked as cold. On top of that, since they're only ever run once, they might as well be minsize.
I observed a 0.21% code size improvement in a standard release build of clang for x86 with this change.
Paths
| Differential D59509
Make static constructors + destructors minsize + cold (except for in -O0) Needs ReviewPublic Authored by paquette on Mar 18 2019, 1:28 PM.
Details
Diff Detail Event Timelinelebedev.ri added inline comments.
Comment Actions Looks reasonable to me.
Comment Actions Made the test less fragile by splitting the WITHOUT-NOT into three lines. (Thanks for the suggestion!)
Revision Contents
Diff 196085 clang/lib/CodeGen/CGDeclCXX.cpp
clang/test/CodeGen/address-safety-attr.cpp
clang/test/CodeGen/static-attr.cpp
|
This is fragile, it may have false-negative if they appear in other order.