示例#1
0
	/* static */ void RegAlloc::formatRegisters(RegAlloc& regs, char* s, Fragment *frag)
	{
		if (!frag || !frag->lirbuf)
			return;
		LirNameMap *names = frag->lirbuf->names;
		for(int i=0; i<(LastReg+1); i++)
		{
			LIns* ins = regs.active[i];
			Register r = (Register)i;
			if (ins && regs.isFree(r))
				{ NanoAssertMsg( 0, "Coding error; register is both free and active! " ); }
			//if (!ins && !regs.isFree(r))
			//	{ NanoAssertMsg( 0, "Coding error; register is not in the free list when it should be" ); }
			if (!ins)
				continue;				

			s += strlen(s);
			const char* rname = ins->isQuad() ? fpn(r) : gpn(r);
			sprintf(s, " %s(%s)", rname, names->formatRef(ins));
		}
	}
示例#2
0
    void RegAlloc::formatRegisters(char* s, Fragment *frag)
    {
        if (!frag || !frag->lirbuf)
            return;
        LirNameMap *names = frag->lirbuf->names;
        for (Register r = FirstReg; r <= LastReg; r = nextreg(r))
        {
            LIns *ins = getActive(r);
            if (!ins)
                continue;
            NanoAssertMsg(!isFree(r), "Coding error; register is both free and active! " );

            if (ins->isop(LIR_param) && ins->paramKind()==1 && r == Assembler::savedRegs[ins->paramArg()]) {
                // dont print callee-saved regs that arent used
                continue;
            }

            s += VMPI_strlen(s);
            const char* rname = ins->isQuad() ? fpn(r) : gpn(r);
            VMPI_sprintf(s, " %s(%s)", rname, names->formatRef(ins));
        }
    }