Symbol *TypedefDeclaration::toInitializer() { if (!sinit) { Classsym *stag = fake_classsym(Id::ClassInfo); Symbol *s = toSymbolX("__init", SCextern, stag->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; slist_add(s); sinit = s; } return sinit; }
void visit(Module *m) { if (!m->csym) { if (!scc) scc = fake_classsym(Id::ClassInfo); Symbol *s = m->toSymbolX("__ModuleInfo", SCextern, scc->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; m->csym = s; slist_add(s); } result = m->csym; }
Symbol *Module::toSymbol() { if (!csym) { if (!scc) scc = fake_classsym(Id::ClassInfo); Symbol *s = toSymbolX("__ModuleInfo", SCextern, scc->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; csym = s; slist_add(s); } return csym; }
Symbol *AggregateDeclaration::toInitializer() { if (!sinit) { Classsym *stag = fake_classsym(Id::ClassInfo); Symbol *s = toSymbolX("__init", SCextern, stag->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; StructDeclaration *sd = isStructDeclaration(); if (sd) s->Salignment = sd->alignment; slist_add(s); sinit = s; } return sinit; }
void visit(InterfaceDeclaration *id) { if (!id->csym) { if (!scc) scc = fake_classsym(Id::ClassInfo); Symbol *s = id->toSymbolX("__Interface", SCextern, scc->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; id->csym = s; slist_add(s); } result = id->csym; }
void visit(ClassDeclaration *cd) { if (!cd->csym) { if (!scc) scc = fake_classsym(Id::ClassInfo); Symbol *s = cd->toSymbolX("__Class", SCextern, scc->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; cd->csym = s; slist_add(s); } result = cd->csym; }
Symbol *AggregateDeclaration::toInitializer() { Symbol *s; Classsym *stag; if (!sinit) { stag = fake_classsym(NULL); s = toSymbolX("__init", SCextern, stag->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; slist_add(s); sinit = s; } return sinit; }
Symbol *InterfaceDeclaration::toSymbol() { if (!csym) { Symbol *s; if (!scc) scc = fake_classsym("ClassInfo"); s = toSymbolX("_Interface_", SCextern, scc->Stype); s->Sfl = FLextern; s->Sflags |= SFLnodebug; csym = s; slist_add(s); } return csym; }
Symbol *EnumDeclaration::toInitializer() { if (!sinit) { Classsym *stag = fake_classsym(Id::ClassInfo); Identifier *ident_save = ident; if (!ident) ident = Lexer::uniqueId("__enum"); Symbol *s = toSymbolX("__init", SCextern, stag->Stype, "Z"); ident = ident_save; s->Sfl = FLextern; s->Sflags |= SFLnodebug; slist_add(s); sinit = s; } return sinit; }
Symbol *ClassDeclaration::toSymbol() { if (!csym) { Symbol *s; if (!scc) scc = fake_classsym(Id::ClassInfo); s = toSymbolX("__Class", SCextern, scc->Stype, "Z"); s->Sfl = FLextern; s->Sflags |= SFLnodebug; csym = s; slist_add(s); } return csym; }
Symbol *toInitializer(EnumDeclaration *ed) { if (!ed->sinit) { Classsym *stag = fake_classsym(Id::ClassInfo); Identifier *ident_save = ed->ident; if (!ed->ident) ed->ident = Identifier::generateId("__enum"); Symbol *s = toSymbolX(ed, "__init", SCextern, stag->Stype, "Z"); ed->ident = ident_save; s->Sfl = FLextern; s->Sflags |= SFLnodebug; slist_add(s); ed->sinit = s; } return ed->sinit; }
Symbol *Module::toSymbol() { if (!csym) { Symbol *s; static Classsym *scc; if (!scc) scc = fake_classsym("ModuleInfo"); s = toSymbolX("_ModuleInfo_", SCextern, scc->Stype); s->Sfl = FLextern; s->Sflags |= SFLnodebug; csym = s; slist_add(s); } return csym; }
Symbol *AggregateDeclaration::toInitializer() { char *id; char *n; Symbol *s; Classsym *stag; if (!sinit) { n = mangle(); stag = fake_classsym(n); id = (char *) alloca(6 + strlen(n) + 1); sprintf(id,"_init_%s",n); s = symbol_calloc(id); s->Stype = stag->Stype; s->Sclass = SCextern; s->Sfl = FLextern; s->Sflags |= SFLnodebug; slist_add(s); sinit = s; } return sinit; }