if (IS_AGGREGATE (ftype))
{
- // jwk: don't we need aggregateToPointer here?
newType = newAst_LINK (copyLinkChain (ftype));
DCL_TYPE (newType->opval.lnk) = GPOINTER;
}
#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 */
}
LLVAL (tree) = 1;
- propAsgType (tree);
-
return tree;
case AND_ASSIGN:
}
LLVAL (tree) = 1;
- propAsgType (tree);
-
return tree;
/*------------------------------------------------------------------*/
}
LLVAL (tree) = 1;
- propAsgType (tree);
-
return tree;
/*------------------------------------------------------------------*/
tree->right = decorateType (newNode ('+', copyAst (tree->left), tree->right));
tree->opval.op = '=';
- propAsgType (tree);
-
return tree;
/*------------------------------------------------------------------*/
goto errorTreeReturn;
}
- propAsgType (tree);
-
return 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;