Ejemplo n.º 1
0
void AliasGosub(QUAD *tail, BITINT *parms, BITINT *bits, int n)
{
    int i;
    andmap(bits, uivBytes);
    tail = tail->back;
    while (tail && tail->dc.opcode != i_block && tail->dc.opcode != i_gosub && tail->dc.opcode != i_label)
    {
        if (tail->dc.opcode == i_parm)
        {
            if (tail->temps & TEMP_LEFT)
            {
                ALIASLIST *al = tempInfo[tail->dc.left->offset->v.sp->value.i]->pointsto;
                ResetProcessed();
                scanDepends(parms, al);
            }
            else
            {
                AliasUses(parms, tail->dc.left, TRUE);
            }
            
        }
        tail = tail->back;
    }
    for (i=0; i < n; i++)
    {
        *bits &= ~*parms;
        bits++, parms++;
    }
    
}
Ejemplo n.º 2
0
void AliasStruct(BITINT *bits, IMODE *ans, IMODE *left, IMODE *right)
{
    ALIASLIST *src;
    int i, n = ans->offset->v.i;
    if (left->offset->type == en_tempref && left->mode == i_direct)
    {
        src = tempInfo[left->offset->v.sp->value.i]->pointsto;
        while (src)
        {
            ALIASADDRESS *aa = src->address;
            while (aa->merge) aa = aa->merge;
            for (i=0; i < n; i++)
            {
                ALIASNAME *an = GetAliasName(aa->name, i);
				if (an)
				{
					ALIASADDRESS *aa2 = LookupAddress(an, 0);
					while (aa2->merge) aa2 = aa2->merge;
					if (aa2 && aa2->modifiedBy)
					{
						ormap(bits, aa2->modifiedBy);
					}
				}
            }
            src = src->next;
        }
        setbit(bits, termMap[left->offset->v.sp->value.i]);
        return;
    }
    else if (left->mode == i_immed)
    {
        ALIASNAME *an = LookupMem(left);
        ALIASADDRESS *aa;
        for (i=0; i < n; i++)
        {
            ALIASNAME *an2 = GetAliasName(an, i);
			if (an2)
			{
				aa = LookupAddress(an2, 0);
				while (aa->merge) aa = aa->merge;
				if (aa && aa->modifiedBy)
				{
					ormap(bits, aa->modifiedBy);
				}
				ResetProcessed();
				scanDepends(bits, aa->pointsto);
			}
        }
        return;
    }
    else
    {
        diag("AliasStruct: invalid src type");
    }	
}
Ejemplo n.º 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);
}
Ejemplo n.º 4
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;
        }
    }
}
Ejemplo n.º 5
0
static void ScanMem(void)
{
    int i,k;
    int n = (termCount + BITINTBITS-1)/BITINTBITS;
    do 
    {
        changed = FALSE;
        ResetProcessed();
        for (i=0; i < DAGSIZE; i++)
        {
            ALIASADDRESS *aa = addresses[i];
            while (aa)
            {
                ALIASADDRESS *aa1 = aa;
                while (aa1->merge) aa1 = aa1->merge;
                GatherInds(&aa1->modifiedBy[0], n, aa->pointsto);
                aa = aa->next;
            }
        }
    } while (changed);
}