[swift-dev] Changing how nominal type descriptors store type names

Dmitri Gribenko gribozavr at gmail.com
Fri Jan 22 20:35:32 CST 2016


On Fri, Jan 22, 2016 at 6:21 PM, Joe Groff via swift-dev
<swift-dev at swift.org> wrote:
> @"nominal type descriptor for Foo.Bar" = {
>   .name = relative reference to "Bar",
>   .moduleName = relative reference to "Foo"
> }
>
>
> The one exception is the standard library, which gets a special one-character mangling; we could maybe pack an "is in standard library" bit somewhere so we avoid storing an extra reference in that case. Any objections or concerns?

Since `moduleName` can't be 0, you can define 0 to mean "Swift
module".  You can also reserve a few low integers, say 0..<1024, for
other special names -- like __C.  Maybe others will come up in future.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-dev mailing list