void mangleDecl(OutBuffer *buf, Declaration *sthis) { mangleParent(buf, sthis); assert(sthis->ident); const char *id = sthis->ident->toChars(); buf->printf("%llu%s", (ulonglong)strlen(id), id); if (FuncDeclaration *fd = sthis->isFuncDeclaration()) { mangleFunc(buf, fd, false); } else if (sthis->type->deco) { buf->writestring(sthis->type->deco); } else assert(0); }
void mangleDecl(Declaration *sthis) { mangleParent(sthis); assert(sthis->ident); const char *id = sthis->ident->toChars(); toBuffer(id, sthis); if (FuncDeclaration *fd = sthis->isFuncDeclaration()) { mangleFunc(fd, false); } else if (sthis->type->deco) { buf->writestring(sthis->type->deco); } else assert(0); }
void mangleParent(OutBuffer *buf, Dsymbol *s) { Dsymbol *p; if (TemplateInstance *ti = s->isTemplateInstance()) p = ti->isTemplateMixin() ? ti->parent : ti->tempdecl->parent; else p = s->parent; if (p) { mangleParent(buf, p); if (p->getIdent()) { const char *id = p->ident->toChars(); buf->printf("%llu%s", (ulonglong)strlen(id), id); if (FuncDeclaration *f = p->isFuncDeclaration()) mangleFunc(buf, f, true); } else buf->writeByte('0'); } }
void mangleParent(Dsymbol *s) { Dsymbol *p; if (TemplateInstance *ti = s->isTemplateInstance()) p = ti->isTemplateMixin() ? ti->parent : ti->tempdecl->parent; else p = s->parent; if (p) { mangleParent(p); if (p->getIdent()) { const char *id = p->ident->toChars(); toBuffer(id, s); if (FuncDeclaration *f = p->isFuncDeclaration()) mangleFunc(f, true); } else buf->writeByte('0'); } }