HOST_WIDE_INT
cxx_get_alias_set (tree t)
{
  if (IS_FAKE_BASE_TYPE (t))
    /* The base variant of a type must be in the same alias set as the
       complete type.  */
    return get_alias_set (TYPE_CONTEXT (t));

  /* Punt on PMFs until we canonicalize functions properly.  */
  if (TYPE_PTRMEMFUNC_P (t))
    return 0;

  return c_common_get_alias_set (t);
}
Exemple #2
0
static HOST_WIDE_INT
cxx_get_alias_set (tree t)
{
    if (TREE_CODE (t) == RECORD_TYPE
            && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t))
            && CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t)
        /* The base variant of a type must be in the same alias set as the
           complete type.  */
        return get_alias_set (TYPE_CONTEXT (t));

    if (/* It's not yet safe to use alias sets for some classes in C++.  */
        !ok_to_generate_alias_set_for_type (t)
        /* Nor is it safe to use alias sets for pointers-to-member
        functions, due to the fact that there may be more than one
         RECORD_TYPE type corresponding to the same pointer-to-member
         type.  */
        || TYPE_PTRMEMFUNC_P (t))
        return 0;

    return c_common_get_alias_set (t);
}