more function pointer issues
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Nov 2001 12:01:27 +0000 (12:01 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 5 Nov 2001 12:01:27 +0000 (12:01 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1506 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCdflow.c
src/SDCCicode.c
src/SDCCicode.h

index dee5cbb9cda6c8e09adabb27b79a5afb7d03d1f7..afdba8eacaf113915ca97562e9176e0e35c98fa3 100644 (file)
@@ -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;
        }
index 7dca929a28cb09708a605048325f32af70359385..f20805701514a3a22e6457bb8c4b9d2d1ace7f8d 100644 (file)
@@ -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);
index a7534ecca0151ab617cff4f1c51c7efb23d673ce..f1a9d63e2b567b1e82176fdfede5bb52da38d5f6 100644 (file)
@@ -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;