operand *right;
symbol *func = NULL;
int lineno = ic->lineno;
+ int bytesPushed=0;
ip = ic->next; /* insertion point */
/* remove it from the iCode */
{
newic = newiCode (IPUSH, right, NULL);
newic->parmPush = 1;
+ bytesPushed+=4;
}
addiCodeToeBBlock (ebp, newic, ip);
{
newic = newiCode (IPUSH, left, NULL);
newic->parmPush = 1;
+ bytesPushed+=4;
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
/* insert the call */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
- addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
+ newic->parmBytes+=bytesPushed;
+ addiCodeToeBBlock (ebp, newic, ip);
}
/*-----------------------------------------------------------------*/
{
for (su = 0; su < 2; su++)
{
- if (checkType (type, __multypes[bwd][su]) == 1)
+ if (compareType (type, __multypes[bwd][su]) == 1)
{
func = __conv[0][bwd][su];
goto found;
{
for (su = 0; su < 2; su++)
{
- if (checkType (type, __multypes[bwd][su]) == 1)
+ if (compareType (type, __multypes[bwd][su]) == 1)
{
func = __conv[1][bwd][su];
goto found;
int lineno = ic->lineno;
int bwd;
int su;
+ int bytesPushed=0;
+
remiCodeFromeBBlock (ebp, ic);
/* depending on the type */
{
for (su = 0; su < 2; su++)
{
- if (checkType (type, __multypes[bwd][su]) == 1)
+ if (compareType (type, __multypes[bwd][su]) == 1)
{
if (op == '*')
func = __muldiv[0][bwd][su];
{
newic = newiCode (IPUSH, IC_RIGHT (ic), NULL);
newic->parmPush = 1;
+ bytesPushed += getSize(type);
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
{
newic = newiCode (IPUSH, IC_LEFT (ic), NULL);
newic->parmPush = 1;
+ bytesPushed += getSize(type);
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
/* for the result */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
- addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
-
+ newic->parmBytes+=bytesPushed; // to clear the stack after the call
+ addiCodeToeBBlock (ebp, newic, ip);
}
/*-----------------------------------------------------------------*/