Пример #1
0
Файл: type.c Проект: michelf/dmd
void type_hydrate(type **pt)
{
    type *t;

    assert(pt);
    while (isdehydrated(*pt))
    {
        t = (type *) ph_hydrate(pt);
        type_debug(t);
#if !TX86
        if (t->Tflags & TFhydrated)
            return;
#if SOURCE_4TYPES
        t->Tsrcpos.Sfilnum += File_Hydrate_Num; /* file number relative header build */
#endif
        t->Tflags |= TFhydrated;
#endif
        switch (tybasic(t->Tty))
        {
            case TYstruct:
            case TYenum:
            case TYmemptr:
            case TYvtshape:
                // Cannot assume symbol is hydrated, because entire HX file
                // may not have been hydrated.
                Classsym_hydrate(&t->Ttag);
                symbol_debug(t->Ttag);
                break;
            case TYident:
                ph_hydrate(&t->Tident);
                break;
            case TYtemplate:
                symbol_hydrate(&((typetemp_t *)t)->Tsym);
                param_hydrate(&t->Tparamtypes);
                break;
            case TYarray:
                if (t->Tflags & TFvla)
                    el_hydrate(&t->Tel);
                break;
            default:
                if (tyfunc(t->Tty))
                {   param_hydrate(&t->Tparamtypes);
                    list_hydrate(&t->Texcspec, (list_free_fp)type_hydrate);
                }
#if SCPP
                else if (t->Talternate && typtr(t->Tty))
                    type_hydrate(&t->Talternate);
#endif
#if MARS
                else if (t->Tkey && typtr(t->Tty))
                    type_hydrate(&t->Tkey);
#endif
                break;
        }
        pt = &t->Tnext;
    }
}
Пример #2
0
void type_hydrate(type **pt)
{
    type *t;

    assert(pt);
    while (isdehydrated(*pt))
    {
        t = (type *) ph_hydrate(pt);
        type_debug(t);
        switch (tybasic(t->Tty))
        {
            case TYstruct:
            case TYenum:
            case TYmemptr:
            case TYvtshape:
                // Cannot assume symbol is hydrated, because entire HX file
                // may not have been hydrated.
                Classsym_hydrate(&t->Ttag);
                symbol_debug(t->Ttag);
                break;
            case TYident:
                ph_hydrate(&t->Tident);
                break;
            case TYtemplate:
                symbol_hydrate(&((typetemp_t *)t)->Tsym);
                param_hydrate(&t->Tparamtypes);
                break;
            case TYarray:
                if (t->Tflags & TFvla)
                    el_hydrate(&t->Tel);
                break;
            default:
                if (tyfunc(t->Tty))
                {   param_hydrate(&t->Tparamtypes);
                    list_hydrate(&t->Texcspec, (list_free_fp)type_hydrate);
                }
                else if (t->Talternate && typtr(t->Tty))
                    type_hydrate(&t->Talternate);
                else if (t->Tkey && typtr(t->Tty))
                    type_hydrate(&t->Tkey);
                break;
        }
        pt = &t->Tnext;
    }
}