This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Great example of why "everything is a tree" sucks
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Tue, 12 Nov 2013 21:35:09 +0100
- Subject: Re: Great example of why "everything is a tree" sucks
- Authentication-results: sourceware.org; auth=none
- References: <528288B3 dot 8010109 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 12, 2013 at 12:59:47PM -0700, Jeff Law wrote:
> So I lost something like 3 hrs last night due to writing a hunk of
> code like this
>
> if (INTEGRAL_TYPE_P (gimple_assign_lhs (stmt)))
INTEGRAL_TYPE_P is a macro, which accepts everything, just adding
a TYPE_CHECK to that macro would be sufficient to catch that
(but of course could break various parts of GCC, so if you wanted
to change the representation of types from tree to tree_type or
something similar, the addition of the TYPE_CHECK would be probably
first step towards that).
Note that we have tons of code which accept either objects or types,
both in the frontends and in the middle-end, so changing TREE_TYPE
from tree to something else is definitely non-trivial.
Jakub