compiler support added for precise GC

Jacob Carlborg doob at me.com
Mon Apr 16 23:33:09 PDT 2012


On 2012-04-16 22:52, Steven Schveighoffer wrote:

> I feel this actually can be more generic. Can we change this to a more
> generic term? For example getRTInfo (short for get runtime info) and
> RTInfo(T)?
>
> Here is my thought: the GC is not the only entity that might be
> interested in permanently storing compile-time info for use at runtime.
> Yes, the GC could use this (perhaps exclusively), but this actually
> works as a fairly good hook to generate RTTI necessary to do reflection.
>
> Previously, one had to either parse the object file or make multiple
> passes through the compiler to generate the info and then include it.
> With this template solution, the compiler generates the info using the
> template and then stores it in TypeInfo.
>
> But we need to change the name early on to avoid conflicts. I don't
> think a more generic name would be inappropriate, even if the GC is the
> only client at first.
>
> -Steve

If we get custom attributes perhaps this case be used to store them. 
BTW, why not make it a property and drop the "get" prefix.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list