Bug in TypeInfo generation?

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 9 17:25:39 UTC 2018


On Tue, Jan 09, 2018 at 06:20:31PM +0100, Benjamin Thaut via Digitalmars-d wrote:
> [...] The compiler should be able to figure out that the destructor of
> SomeOtherStruct must already exist, as its clearly always
> instanciated. As a result the compiler should not instanciate the
> TypeInfo for SomeStruct but instead assume that it also already
> exists.  By doing so it would never write the SomeStruct type info to
> the object file and the linker errors would go away.
> 
> I'm asking this because this behavior for type info generation turns
> out to be a problem for my dll-work.
[...]

AFAIK, originally the compiler had a similar behaviour when it comes to
instantiating templates, but some time ago that was changed so that the
relevant symbols were only generated if the module they originate from
is currently being compiled.

I think it will be a very good idea to implement something similar for
this dtor case as well, if not for the entire typeinfo generation
process.  It will help to cut off more unnecessary linker dependencies
and reduce the amount of executable bloat when linking in a library
where not all symbols are actually used.


T

-- 
Turning your clock 15 minutes ahead won't cure lateness---you're just making time go faster!


More information about the Digitalmars-d mailing list