This is the mail archive of the
mailing list for the GCC project.
Re: RFC: g++ aliasing (was: Re: g++ and aliasing bools)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Dan Nicolaescu <dann at godzilla dot ICS dot UCI dot EDU>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: Joe Buck <jbuck at synopsys dot com>, Daniel Berlin <dan at dberlin dot org>
- Date: Wed, 06 Mar 2002 13:17:41 -0800
- Subject: Re: RFC: g++ aliasing (was: Re: g++ and aliasing bools)
- References: <firstname.lastname@example.org>
+ /* Check if a C++ type is safe for aliasing.
You need to say what T is in the comment and what the return value
> + PODs are safe.
> + Classes with virtual bases are not safe.
> + All the members of a class should be safe. */
You don't need to say that; that's implementation detail, not interface.
> + static bool
> + cxx_simple_enough_type (t)
> + tree t;
We need a better name; I suggest "ok_to_generate_alias_set_for_type()",
or something along those lines.
> + if (TYPE_USES_VIRTUAL_BASECLASSES (t))
> + return false;
You need to recursively check non-virtual base classes, too, don't you?
Mark Mitchell email@example.com
CodeSourcery, LLC http://www.codesourcery.com