+2000-08-04 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * inc/cxxabi.h (__pbase_type_info): Changed member names to match
+ specifications.
+ (__pointer_to_member_type_info): Likewise.
+ (__base_class_info): Likewise.
+ (__class_type_info): Likewise.
+ (__si_class_type_info): Likewise.
+ (__vmi_class_type_info): Likewise.
+ * tinfo.cc (__si_class_type_info::__do_find_public_src):
+ Changed member names to match specifications.
+ (__vmi_class_type_info::__do_find_public_src): Likewise.
+ (__si_class_type_info::__do_dyncast): Likewise.
+ (__vmi_class_type_info::__do_dyncast): Likewise.
+ (__si_class_type_info::__do_upcast): Likewise.
+ (__vmi_class_type_info::__do_upcast): Likewise.
+ * tinfo2.cc (__pbase_type_info::__do_catch): Likewise.
+ (__pbase_type_info::__pointer_catch): Likewise.
+ (__pointer_type_info::__pointer_catch): Likewise.
+ (__pointer_to_member_type_info::__pointer_catch): Likewise.
+
+
2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
* Make-lang.in (cc1plus): Depend on $(BACKEND), not stamp-objlist.
{
/* abi defined member variables */
public:
- int quals; /* qualification of the target object */
- const std::type_info *type; /* type of pointed to object */
+ unsigned int __qualifier_flags; /* qualification of the target object */
+ const std::type_info *__pointee; /* type of pointed to object */
/* abi defined member functions */
public:
explicit __pbase_type_info (const char *__n,
int __quals,
const std::type_info *__type)
- : std::type_info (__n), quals (__quals), type (__type)
+ : std::type_info (__n), __qualifier_flags (__quals), __pointee (__type)
{ }
/* implementation defined types */
public:
- enum quals_masks {
- const_mask = 0x1,
- volatile_mask = 0x2,
- restrict_mask = 0x4,
- incomplete_mask = 0x8,
- incomplete_class_mask = 0x10
+ enum __qualifier_masks {
+ __const_mask = 0x1,
+ __volatile_mask = 0x2,
+ __restrict_mask = 0x4,
+ __incomplete_mask = 0x8,
+ __incomplete_class_mask = 0x10
};
/* implementation defined member functions */
{
/* abi defined member variables */
public:
- const __class_type_info *klass; /* class of the member */
+ __class_type_info *__context_class; /* class of the member */
/* abi defined member functions */
public:
explicit __pointer_to_member_type_info (const char *__n,
int __quals,
const std::type_info *__type,
- const __class_type_info *__klass)
- : __pbase_type_info (__n, __quals, __type), klass (__klass)
+ __class_type_info *__klass)
+ : __pbase_type_info (__n, __quals, __type), __context_class (__klass)
{ }
/* implementation defined member functions */
{
/* abi defined member variables */
public:
- const __class_type_info *base; /* base class type */
- long vmi_offset_flags; /* offset and info */
+ const __class_type_info *__base; /* base class type */
+ long __offset_flags; /* offset and info */
/* implementation defined types */
public:
- enum vmi_masks {
- virtual_mask = 0x1,
- public_mask = 0x2,
+ enum __offset_flags_masks {
+ __virtual_mask = 0x1,
+ __public_mask = 0x2,
hwm_bit = 2,
offset_shift = 8 /* bits to shift offset by */
};
/* implementation defined member functions */
public:
bool __is_virtual_p () const
- { return vmi_offset_flags & virtual_mask; }
+ { return __offset_flags & __virtual_mask; }
bool __is_public_p () const
- { return vmi_offset_flags & public_mask; }
+ { return __offset_flags & __public_mask; }
__PTRDIFF_TYPE__ __offset () const
{
// This shift, being of a signed type, is implementation defined. GCC
// implements such shifts as arithmetic, which is what we want.
- return static_cast<__PTRDIFF_TYPE__> (vmi_offset_flags) >> offset_shift;
+ return static_cast<__PTRDIFF_TYPE__> (__offset_flags) >> offset_shift;
}
};
/* publicly) */
__contained_ambig, /* contained ambiguously */
- __contained_virtual_mask = __base_class_info::virtual_mask, /* via a virtual path */
- __contained_public_mask = __base_class_info::public_mask, /* via a public path */
+ __contained_virtual_mask = __base_class_info::__virtual_mask, /* via a virtual path */
+ __contained_public_mask = __base_class_info::__public_mask, /* via a public path */
__contained_mask = 1 << __base_class_info::hwm_bit, /* contained within us */
__contained_private = __contained_mask,
: public __class_type_info
{
/* abi defined member variables */
-protected:
- const __class_type_info *base; /* base type */
+public:
+ const __class_type_info *__base_type;
/* abi defined member functions */
public:
public:
explicit __si_class_type_info (const char *__n,
const __class_type_info *__base)
- : __class_type_info (__n), base (__base)
+ : __class_type_info (__n), __base_type (__base)
{ }
/* implementation defined member functions */
class __vmi_class_type_info : public __class_type_info {
/* abi defined member variables */
public:
- int vmi_flags; /* details about the class heirarchy */
- int vmi_base_count; /* number of direct bases */
- __base_class_info vmi_bases[1]; /* array of bases */
+ unsigned int __flags; /* details about the class heirarchy */
+ unsigned int __base_count; /* number of direct bases */
+ __base_class_info const __base_info[1]; /* array of bases */
/* The array of bases uses the trailing array struct hack
so this class is not constructable with a normal constructor. It is
internally generated by the compiler. */
virtual ~__vmi_class_type_info ();
public:
explicit __vmi_class_type_info (const char *__n,
- int __flags)
- : __class_type_info (__n), vmi_flags (__flags), vmi_base_count (0)
+ int ___flags)
+ : __class_type_info (__n), __flags (___flags), __base_count (0)
{ }
/* implementation defined types */
public:
- enum vmi_flags_masks {
- non_diamond_repeat_mask = 0x1, /* distinct instance of repeated base */
- diamond_shaped_mask = 0x2, /* diamond shaped multiple inheritance */
+ enum __flags_masks {
+ __non_diamond_repeat_mask = 0x1, /* distinct instance of repeated base */
+ __diamond_shaped_mask = 0x2, /* diamond shaped multiple inheritance */
non_public_base_mask = 0x4, /* has non-public direct or indirect base */
public_base_mask = 0x8, /* has public base (direct) */
{
if (src_ptr == obj_ptr && *this == *src_type)
return __contained_public;
- return base->__do_find_public_src (src2dst, obj_ptr, src_type, src_ptr);
+ return __base_type->__do_find_public_src (src2dst, obj_ptr, src_type, src_ptr);
}
__class_type_info::__sub_kind __vmi_class_type_info::
if (obj_ptr == src_ptr && *this == *src_type)
return __contained_public;
- for (size_t i = vmi_base_count; i--;)
+ for (size_t i = __base_count; i--;)
{
- if (!vmi_bases[i].__is_public_p ())
+ if (!__base_info[i].__is_public_p ())
continue; // Not public, can't be here.
const void *base = obj_ptr;
- ptrdiff_t offset = vmi_bases[i].__offset ();
- bool is_virtual = vmi_bases[i].__is_virtual_p ();
+ ptrdiff_t offset = __base_info[i].__offset ();
+ bool is_virtual = __base_info[i].__is_virtual_p ();
if (is_virtual)
{
}
base = convert_to_base (base, is_virtual, offset);
- __sub_kind base_kind = vmi_bases[i].base->__do_find_public_src
+ __sub_kind base_kind = __base_info[i].__base->__do_find_public_src
(src2dst, base, src_type, src_ptr);
if (contained_p (base_kind))
{
result.whole2src = access_path;
return false;
}
- return base->__do_dyncast (src2dst, access_path, dst_type, obj_ptr,
+ return __base_type->__do_dyncast (src2dst, access_path, dst_type, obj_ptr,
src_type, src_ptr, result);
}
__dyncast_result &__restrict result) const
{
if (result.whole_details & __flags_unknown_mask)
- result.whole_details = vmi_flags;
+ result.whole_details = __flags;
if (obj_ptr == src_ptr && *this == *src_type)
{
}
bool result_ambig = false;
- for (size_t i = vmi_base_count; i--;)
+ for (size_t i = __base_count; i--;)
{
__dyncast_result result2 (result.whole_details);
void const *base = obj_ptr;
__sub_kind base_access = access_path;
- ptrdiff_t offset = vmi_bases[i].__offset ();
- bool is_virtual = vmi_bases[i].__is_virtual_p ();
+ ptrdiff_t offset = __base_info[i].__offset ();
+ bool is_virtual = __base_info[i].__is_virtual_p ();
if (is_virtual)
base_access = __sub_kind (base_access | __contained_virtual_mask);
base = convert_to_base (base, is_virtual, offset);
- if (!vmi_bases[i].__is_public_p ())
+ if (!__base_info[i].__is_public_p ())
{
if (src2dst == -2 &&
!(result.whole_details
- & (non_diamond_repeat_mask | diamond_shaped_mask)))
+ & (__non_diamond_repeat_mask | __diamond_shaped_mask)))
// The hierarchy has no duplicate bases (which might ambiguate
// things) and where we started is not a public base of what we
// want (so it cannot be a downcast). There is nothing of interest
}
bool result2_ambig
- = vmi_bases[i].base->__do_dyncast (src2dst, base_access,
+ = __base_info[i].__base->__do_dyncast (src2dst, base_access,
dst_type, base,
src_type, src_ptr, result2);
result.whole2src = __sub_kind (result.whole2src | result2.whole2src);
result.whole2dst = result2.whole2dst;
result_ambig = result2_ambig;
if (result.dst_ptr && result.whole2src != __unknown
- && !(vmi_flags & non_diamond_repeat_mask))
+ && !(__flags & __non_diamond_repeat_mask))
// Found dst and src and we don't have repeated bases.
return result_ambig;
}
if (contained_p (result.whole2src)
&& (!virtual_p (result.whole2src)
- || !(result.whole_details & diamond_shaped_mask)))
+ || !(result.whole_details & __diamond_shaped_mask)))
{
// We already found SRC_PTR as a base of most derived, and
// either it was non-virtual, or the whole heirarchy is
;// already calculated
else if (contained_p (new_sub_kind)
&& (!virtual_p (new_sub_kind)
- || !(vmi_flags & diamond_shaped_mask)))
+ || !(__flags & __diamond_shaped_mask)))
// Already found inside the other choice, and it was
// non-virtual or we are not diamond shaped.
old_sub_kind = __not_contained;
;// already calculated
else if (contained_p (old_sub_kind)
&& (!virtual_p (old_sub_kind)
- || !(vmi_flags & diamond_shaped_mask)))
+ || !(__flags & __diamond_shaped_mask)))
// Already found inside the other choice, and it was
// non-virtual or we are not diamond shaped.
new_sub_kind = __not_contained;
if (__class_type_info::__do_upcast (dst, obj_ptr, result))
return true;
- return base->__do_upcast (dst, obj_ptr, result);
+ return __base_type->__do_upcast (dst, obj_ptr, result);
}
bool __vmi_class_type_info::
int src_details = result.src_details;
if (src_details & __flags_unknown_mask)
- src_details = vmi_flags;
+ src_details = __flags;
- for (size_t i = vmi_base_count; i--;)
+ for (size_t i = __base_count; i--;)
{
__upcast_result result2 (src_details);
const void *base = obj_ptr;
- ptrdiff_t offset = vmi_bases[i].__offset ();
- bool is_virtual = vmi_bases[i].__is_virtual_p ();
- bool is_public = vmi_bases[i].__is_public_p ();
+ ptrdiff_t offset = __base_info[i].__offset ();
+ bool is_virtual = __base_info[i].__is_virtual_p ();
+ bool is_public = __base_info[i].__is_public_p ();
- if (!is_public && !(src_details & non_diamond_repeat_mask))
+ if (!is_public && !(src_details & __non_diamond_repeat_mask))
// original cannot have an ambiguous base, so skip private bases
continue;
if (base)
base = convert_to_base (base, is_virtual, offset);
- if (vmi_bases[i].base->__do_upcast (dst, base, result2))
+ if (__base_info[i].__base->__do_upcast (dst, base, result2))
{
if (result2.base_type == nonvirtual_base_type && is_virtual)
- result2.base_type = vmi_bases[i].base;
+ result2.base_type = __base_info[i].__base;
if (contained_p (result2.part2dst) && !is_public)
result2.part2dst = __sub_kind (result2.part2dst & ~__contained_public_mask);
if (result.part2dst & __contained_public_mask)
{
- if (!(vmi_flags & non_diamond_repeat_mask))
+ if (!(__flags & __non_diamond_repeat_mask))
return true; // cannot have an ambiguous other base
}
else
{
if (!virtual_p (result.part2dst))
return true; // cannot have another path
- if (!(vmi_flags & diamond_shaped_mask))
+ if (!(__flags & __diamond_shaped_mask))
return true; // cannot have a more accessible path
}
}
const __pbase_type_info *thrown_type =
static_cast <const __pbase_type_info *> (thr_type);
- if (thrown_type->quals & ~quals)
+ if (thrown_type->__qualifier_flags & ~__qualifier_flags)
// We're less qualified.
return false;
- if (!(quals & const_mask))
+ if (!(__qualifier_flags & __const_mask))
outer &= ~1;
return __pointer_catch (thrown_type, thr_obj, outer);
void **thr_obj,
unsigned outer) const
{
- return type->__do_catch (thrown_type->type, thr_obj, outer + 2);
+ return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
}
bool __pointer_type_info::
void **thr_obj,
unsigned outer) const
{
- if (outer < 2 && *type == typeid (void))
+ if (outer < 2 && *__pointee == typeid (void))
{
// conversion to void
- return !thrown_type->type->__is_function_p ();
+ return !thrown_type->__pointee->__is_function_p ();
}
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
const __pointer_to_member_type_info *thrown_type =
static_cast <const __pointer_to_member_type_info *> (thr_type);
- if (*klass != *thrown_type->klass)
+ if (*__context_class != *thrown_type->__context_class)
return false; // not pointers to member of same class
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);