Beispiel #1
0
static void MakeAliasLists(void)
{
    int i;
    for (i=0; i < cachedTempCount; i++)
    {
        int n = tempInfo[i]->postSSATemp;
        if (n >= 0 && tempInfo[i]->pointsto)
        {
            tempInfo[n]->pointsto = tempInfo[i]->pointsto;
            tempInfo[i]->pointsto = NULL;
        }
        tempInfo[i]->modifiedBy = aallocbit(termCount);
    }
    for (i=0; i < cachedTempCount; i++)
        if (tempInfo[i]->pointsto)
        {
            ALIASLIST *al = tempInfo[i]->pointsto;
            while (al)
            {
                ALIASADDRESS *aa = al->address;
                while (aa->merge) aa = aa->merge;
                if (!aa->modifiedBy)
                    aa->modifiedBy = aallocbit(termCount);
                setbit(aa->modifiedBy, termMap[i]);
                al = al->next;
            }
        }
}
Beispiel #2
0
static void GatherInds(BITINT *p, int n, ALIASLIST *al)
{
    while (al)
    {
        int k;
        BITINT *r, *s;
        if (!isset(processBits, al->address->processIndex))
        {
            setbit(processBits, al->address->processIndex);
            GatherInds(p, n, al->address->pointsto);
        }
        s = p;
        r = al->address->modifiedBy;
        if (s)
        {
            if (!r)
                r = al->address->modifiedBy = aallocbit(termCount);
            for (k=0; k < n; k++)
            {
                if (~*r & *s)
                {
                    changed = TRUE;
                    *r |= *s;
                }
                r++, s++;
            }
        }
        al = al->next;		
    }
}
Beispiel #3
0
static void ScanUIVs(void)
{
    int n = (tempCount + BITINTBITS-1)/BITINTBITS;
    BOOL done = FALSE;
    ALIASLIST *al = parmList;
    int i;
    ResetProcessed();
    uivBytes = aallocbit(tempCount);
    /*
    while (al)
    {   
        scanDepends(uivBytes, al->address->pointsto, n);
        al = al->next;
    }
    */
    for (i=0; i < DAGSIZE; i++)
    {
        ALIASADDRESS *aa = addresses[i];
        while (aa)
        {
            ALIASADDRESS *aa1 = aa;
            IMODE *im;
            while (aa1->merge) aa1 = aa1->merge;
            if (aa1->name->byUIV)
            {
                im = aa1->name->v.uiv->im;
            }
            else
            {
                im = aa1->name->v.name;
            }
            switch (im->offset->type)
            {
                case en_auto:
                    if (im->offset->v.sp->storage_class != sc_parameter)
                        break;
                case en_global:
                case en_label:
                case en_pc:
                case en_threadlocal:
                    im = GetLoadTemp(im);
                    if (im)
                        setbit(uivBytes, im->offset->v.sp->value.i);
                    break;
            }
            aa = aa->next;
        }
    }
    complementmap(uivBytes);
}
Beispiel #4
0
static void AllocateProcessed(void)
{
    int i;
    processCount = 0;
    for (i=0; i < DAGSIZE; i++)
    {
        ALIASADDRESS *addr = addresses[i];
        while (addr)
        {
            ALIASADDRESS *aa = addr;
            while (aa->merge)
                aa = aa->merge;
            aa->processIndex = processCount++;
            addr = addr->next;
        }
    }
    processBits = aallocbit(processCount);
}
Beispiel #5
0
static void ScanUIVs(void)
{
    BOOLEAN done = FALSE;
    ALIASLIST *al = parmList;
    int i;
    ResetProcessed();
    uivBytes = aallocbit(termCount);
    for (i=0; i < DAGSIZE; i++)
    {
        ALIASADDRESS *aa = addresses[i];
        while (aa)
        {
            ALIASADDRESS *aa1 = aa;
            IMODE *im;
            while (aa1->merge) aa1 = aa1->merge;
            if (aa1->name->byUIV)
            {
                im = aa1->name->v.uiv->im;
            }
            else
            {
                im = aa1->name->v.name;
            }
            switch (im->offset->type)
            {
                case en_auto:
                case en_global:
                case en_label:
                case en_pc:
                case en_threadlocal:
                    im = GetLoadTemp(im);
                    if (im)
                        setbit(uivBytes, termMap[im->offset->v.sp->value.i]);
                    break;
                default:
                    break;
            }
            aa = aa->next;
        }
    }
}