This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] remove the unsigned_type language hook
Could you explain what the plan is exactly? Which one among the related lang
hooks are you going to keep?
The plan is to process any language specific type in the front end
itself. I am trying to remove as many hooks as possible.
> * gcc/ada/utils.c (gnat_unsigned_type): Remove.
-/* Return the unsigned version of a TYPE_NODE, a scalar type. */
-
-tree
-gnat_unsigned_type (tree type_node)
-{
- tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1);
-
- if (TREE_CODE (type_node) == INTEGER_TYPE && TYPE_MODULAR_P (type_node))
- {
- type = copy_node (type);
- TREE_TYPE (type) = type_node;
- }
- else if (TREE_TYPE (type_node)
- && TREE_CODE (TREE_TYPE (type_node)) == INTEGER_TYPE
- && TYPE_MODULAR_P (TREE_TYPE (type_node)))
- {
- type = copy_node (type);
- TREE_TYPE (type) = TREE_TYPE (type_node);
- }
-
- return type;
-}
How is that supposed to be accounted for in the new implementation?
Ada was the only front end that was coping nodes. Note sure why. I was
unable to find any cases were this makes a difference. I don't know
ada or the workings of the ada front end, so I might have missed
something.
Thanks,
Rafael