Cleaned it up a little
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 24 Oct 2001 08:56:08 +0000 (08:56 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 24 Oct 2001 08:56:08 +0000 (08:56 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1438 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c

index 4572ac760c72eb72dc2db377f491334cc8e78b99..d8d961a16668b1330853943a3b3bc6bca95e77b0 100644 (file)
@@ -685,7 +685,6 @@ processParms (ast * func,
 
       if (IS_AGGREGATE (ftype))
        {
-         // jwk: don't we need aggregateToPointer here?
          newType = newAst_LINK (copyLinkChain (ftype));
          DCL_TYPE (newType->opval.lnk) = GPOINTER;
        }
@@ -1827,31 +1826,6 @@ pushTypeCastToLeaves (sym_link * type, ast * node, ast ** parentPtr)
 
 #endif
 
-/*-----------------------------------------------------------------*/
-/* Given an assignment operation in a tree, determine if the LHS   */
-/* (the result) has a different (integer) type than the RHS.     */
-/* If so, walk the RHS and add a typecast to the type of the LHS   */
-/* to all leaf nodes.              */
-/*-----------------------------------------------------------------*/
-void 
-propAsgType (ast * tree)
-{
-#ifdef DEMAND_INTEGER_PROMOTION
-  if (!IS_INTEGRAL (LTYPE (tree)) || !IS_INTEGRAL (RTYPE (tree)))
-    {
-      /* Nothing to do here... */
-      return;
-    }
-
-  if (getSize (LTYPE (tree)) > getSize (RTYPE (tree)))
-    {
-      pushTypeCastToLeaves (LTYPE (tree), tree->right, &(tree->right));
-    }
-#else
-  (void) tree;
-#endif
-}
-
 /*-----------------------------------------------------------------*/
 /* decorateType - compute type for this tree also does type cheking */
 /*          this is done bottom up, since type have to flow upwards */
@@ -2940,8 +2914,6 @@ decorateType (ast * tree)
        }
       LLVAL (tree) = 1;
 
-      propAsgType (tree);
-
       return tree;
 
     case AND_ASSIGN:
@@ -2969,8 +2941,6 @@ decorateType (ast * tree)
        }
       LLVAL (tree) = 1;
 
-      propAsgType (tree);
-
       return tree;
 
 /*------------------------------------------------------------------*/
@@ -3006,8 +2976,6 @@ decorateType (ast * tree)
        }
       LLVAL (tree) = 1;
 
-      propAsgType (tree);
-
       return tree;
 
 /*------------------------------------------------------------------*/
@@ -3051,8 +3019,6 @@ decorateType (ast * tree)
       tree->right = decorateType (newNode ('+', copyAst (tree->left), tree->right));
       tree->opval.op = '=';
 
-      propAsgType (tree);
-
       return tree;
 
 /*------------------------------------------------------------------*/
@@ -3107,8 +3073,6 @@ decorateType (ast * tree)
          goto errorTreeReturn;
        }
 
-      propAsgType (tree);
-
       return tree;
 
 /*------------------------------------------------------------------*/
@@ -3171,19 +3135,10 @@ decorateType (ast * tree)
       /* if there is going to be a casing required then add it */
       if (compareType (currFunc->type->next, RTYPE (tree)) < 0)
        {
-#if 0 && defined DEMAND_INTEGER_PROMOTION
-         if (IS_INTEGRAL (currFunc->type->next))
-           {
-             pushTypeCastToLeaves (currFunc->type->next, tree->right, &(tree->right));
-           }
-         else
-#endif
-           {
-             tree->right =
-               decorateType (newNode (CAST,
-                        newAst_LINK (copyLinkChain (currFunc->type->next)),
-                                      tree->right));
-           }
+         tree->right =
+           decorateType (newNode (CAST,
+                          newAst_LINK (copyLinkChain (currFunc->type->next)),
+                                  tree->right));
        }
 
       RRVAL (tree) = 1;