-
-}
-
-#define DEMAND_INTEGER_PROMOTION
-
-#ifdef DEMAND_INTEGER_PROMOTION
-
-/*-----------------------------------------------------------------*/
-/* walk a tree looking for the leaves. Add a typecast to the given */
-/* type to each value leaf node. */
-/*-----------------------------------------------------------------*/
-void
-pushTypeCastToLeaves (sym_link * type, ast * node, ast ** parentPtr)
-{
- if (!node || IS_CALLOP(node))
- {
- /* WTF? We should never get here. */
- return;
- }
-
- if (!node->left && !node->right)
- {
- /* We're at a leaf; if it's a value, apply the typecast */
- if (node->type == EX_VALUE && IS_INTEGRAL (TTYPE (node)))
- {
- *parentPtr = decorateType (newNode (CAST,
- newAst_LINK (copyLinkChain (type)),
- node));
- }
- }
- else
- {
- if (node->left)
- {
- pushTypeCastToLeaves (type, node->left, &(node->left));
- }
- if (node->right)
- {
- pushTypeCastToLeaves (type, node->right, &(node->right));
- }
- }
-}
-
-#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