From: johanknol Date: Wed, 24 Oct 2001 08:56:08 +0000 (+0000) Subject: Cleaned it up a little X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=b85778b23d2d81581bd61f66a7be0236edeea728;p=fw%2Fsdcc Cleaned it up a little git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1438 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index 4572ac76..d8d961a1 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -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;