This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
__builtin_classify_type and typeclass.h
- To: gcc at gcc dot gnu dot org
- Subject: __builtin_classify_type and typeclass.h
- From: Stan Shebs <shebs at apple dot com>
- Date: Tue, 03 Jul 2001 11:17:21 -0700
While digging through Motorola's AltiVec patches, I came upon the
addition of a "vector_type_class" to typeclass.h. Although in a narrow
sense this seems plausible, the whole situation with typeclass.h and
__builtin_classify_type looks kind of broken to me, and I'm wondering
if anybody has any ideas what to do about it.
So the basic situation is that __builtin_classify_type is a way to
get the TREE_CODE of its argument, and to return a value from typeclass.h
that more-or-less corresponds to the tree code. The theory is that
you could use this to make varargs implementations work for instance.
The practice is that I could find no architecture that actually uses
this anymore. Worse, by poking around via Google, I found some
references to it being used *outside* GCC sources, and to top it all
off, its results are being compared to literal integers(!), so most
changes to typeclass.h will break that code.
My suggestion is to evaporate __builtin_classify_type and typeclass.h,
and to inform the people using it outside of GCC; the whole thing just
looks like an accident waiting to happen. Alternatively, it could be
commented out, with a note to revive it if it's ever needed again.
I don't see a way to ensure its testability and the correctness of
the list in typeclass.h.
Stan