RFC: g++ aliasing (was: Re: g++ and aliasing bools)

Mark Mitchell mark@codesourcery.com
Wed Mar 6 13:20:00 GMT 2002


 + /* Check if a C++ type is safe for aliasing.

You need to say what T is in the comment and what the return value
means.

> +    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?

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com



More information about the Gcc mailing list