This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Great example of why "everything is a tree" sucks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]