ldc
ldc copied to clipboard
TypeInfo causes excessive binary bloat
Based on https://issues.dlang.org/show_bug.cgi?id=14758#c15, DMD has improved wrt. unreferenced TypeInfo
s ending up in the binary, while LDC still produces fat binaries (at least did in v1.0 according to the comment).
If someone could point me in the right direction I could attempt a PR?
I think we should actually be in better shape wrt. this than DMD nowadays - class TypeInfos are emitted once in their owning CU only, struct TypeInfos into each referencing CU (so not emitted at all if never referenced - and by referenced, I mean referenced from the codegen layer, no CTFE stuff), and special TypeInfo members only once in their owning CUs (can be stripped by the linker if unreferenced, e.g., if the according struct TypeInfo is never emitted).