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: RFC: g++ aliasing (was: Re: g++ and aliasing bools)


 + /* 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


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