Esempio n. 1
0
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;
}
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
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;
}
Esempio n. 4
0
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;
}
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
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;
}
Esempio n. 8
0
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;
}
Esempio n. 9
0
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;
}
Esempio n. 10
0
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;
}
Esempio n. 11
0
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;
}
Esempio n. 12
0
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;
}
Esempio n. 13
0
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;
}