From: johanknol Date: Mon, 5 Nov 2001 12:01:27 +0000 (+0000) Subject: more function pointer issues X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=6fb875c0a19a0951a3d2bfdb203e2d2ed8038d4e;p=fw%2Fsdcc more function pointer issues git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1506 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCdflow.c b/src/SDCCdflow.c index dee5cbb9..afdba8ea 100644 --- a/src/SDCCdflow.c +++ b/src/SDCCdflow.c @@ -252,9 +252,16 @@ usedBetweenPoints (operand * op, iCode * start, iCode * end) /* true if there is a call */ if (IS_PARM (op) && (lic->op == CALL || - lic->op == PCALL)) - if (isParameterToCall (IC_ARGS (lic), op)) + lic->op == PCALL)) { + value *args; + if (lic->op == CALL) { + args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type); + } else { + args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type->next); + } + if (isParameterToCall (args, op)) return 1; + } if (SKIP_IC2 (lic)) continue; @@ -310,9 +317,14 @@ usedInRemaining (operand * op, iCode * ic) return true */ if (lic->op == CALL || lic->op == PCALL) { - + value *args; + if (lic->op == CALL) { + args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type); + } else { + args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type->next); + } if ((IS_PARM (op) && - isParameterToCall (IC_ARGS (lic), op)) || + isParameterToCall (args, op)) || isOperandGlobal (op)) return lic; } diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 7dca929a..f2080570 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -683,7 +683,6 @@ copyiCode (iCode * ic) case PCALL: IC_RESULT (nic) = operandFromOperand (IC_RESULT (ic)); IC_LEFT (nic) = operandFromOperand (IC_LEFT (ic)); - IC_ARGS (nic) = IC_ARGS (ic); break; case INLINEASM: @@ -2794,7 +2793,6 @@ geniCodeCall (operand * left, ast * parms,int lvl) else ic = newiCode (CALL, left, NULL); - IC_ARGS (ic) = FUNC_ARGS(left->operand.symOperand->type); type = copyLinkChain (operandType (left)->next); etype = getSpec (type); SPEC_EXTR (etype) = 0; @@ -2886,9 +2884,6 @@ geniCodeFunctionBody (ast * tree,int lvl) /* create a proc icode */ ic = newiCode (FUNCTION, func, NULL); - /* if the function has parmas then */ - /* save the parameters information */ - ic->argLabel.args = tree->values.args; ic->lineno = OP_SYMBOL (func)->lineDef; ADDTOCHAIN (ic); diff --git a/src/SDCCicode.h b/src/SDCCicode.h index a7534ecc..f1a9d63e 100644 --- a/src/SDCCicode.h +++ b/src/SDCCicode.h @@ -109,7 +109,7 @@ operand; #define IC_TRUE(x) (x)->ulrrcnd.cnd.trueLabel #define IC_FALSE(x) (x)->ulrrcnd.cnd.falseLabel #define IC_LABEL(x) (x)->argLabel.label -#define IC_ARGS(x) (x)->argLabel.args +// jwk #define IC_ARGS(x) (x)->argLabel.args #define IC_JTCOND(x) (x)->ulrrcnd.jmpTab.condition #define IC_JTLABELS(x) (x)->ulrrcnd.jmpTab.labels #define IC_INLINE(x) (x)->inlineAsm @@ -169,7 +169,7 @@ typedef struct iCode union { symbol *label; /* for a goto statement */ - value *args; /* for a function */ + // jwk value *args; /* for a function */ } argLabel;