This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Canonical types (1/3)
Doug Gregor wrote:
> Some variants are considered equivalent by comptypes, some aren't. For
> instance, variants that change type qualifiers (const, volatile,
> restrict, etc.) are NOT equivalent to the original type. Variants that
> only change the name of the type (e.g., those variants that are
> created for a typedef) are equivalent to the original type. So,
> TYPE_NEXT_VARIANT basically contains a mish-mash of types that are
> somehow related to the TYPE_MAIN_VARIANT, but may or may not be
> equivalent.
The rule *should* be (as per my attribute proposal) that
TYPE_MAIN_VARIANT is always the (well, a, really, due to typedefs)
cv-unqualified form of the type, dropping all "non-semantic" attributes.
Semantic attributes (like alignment, that actually impact code
generation) should create new types, unrelated by TYPE_*_VARIANT.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713