dmd
dmd copied to clipboard
add support for Object.TypeInfoStructGeneric template
Currently, instances of TypeInfo_Struct are generated by a complex and tedious process inside the compiler. This change experiments with using a template in druntime, Object.TypeInfoStructGeneric instead, to generate it. The compiler will know nothing about the contents of TypeInfo_Struct, leaving people free to innovate with the definition of TypeInfoStructGeneric. (All that code in the compiler will be removed once TypeInfoStructGeneric is successful.)
This is analogous to the successful use of Object.RTinfo to generate info for the garbage collector. The implementation of TypeInfoStructGeneric is very similar for that for RTinfo, which can be found in Semantic3Visitor in semantic3.d
This PR makes it so that if Object.TypeInfoStructGeneric is not there, it falls back to the original compiler implementation of TypeInfoStruct.
This is analogous to https://github.com/dlang/dmd/pull/11459
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#11717"