Commit 3bba6ebb by Benjamin Kosnik Committed by Benjamin Kosnik

re PR libstdc++/7442 (cxxabi.h does not match the C++ ABI)


2002-07-31  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/7442
	* libsupc++/cxxabi.h
	(__base_class_info): Change to __base_class_type_info. 2.9.5p6c
	(__base_class_info::__base): Change to __base_type. 2.9.5p6c
	(__base_class_info::offset_shift): Change to __offset_shift. 2.9.5p6c
	(__vmi_class_type_info::__base_info): Don't make const, of type
	__base_class_type_info, as per 2.9.5p6c
	(__pbase_type_info::__qualifier_flags): Change to __flags, as per
	2.9.5p7.
	(__pbase_type_info::__qualifier_masks): Change to __masks, as per
	2.9.5p7.
	(__pointer_to_member_type_info::__context_class): Change member to
	__context, as per 2.9.5p9.
	* libsupc++/tinfo2.cc (__pointer_catch): Change __context_class to
	__context.
	* libsupc++/tinfo2.cc (__do_catch): Change __qualifier_flags to
	__flags.
	* libsupc++/tinfo.cc (__do_find_public_src): Change __base to
	__base_type.
	* libsupc++/tinfo.cc (__do_dyncast): Same.
	* libsupc++/tinfo.cc (__do_upcast): Same.

From-SVN: r55910
parent 5a53872d
2002-07-31 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7442
* libsupc++/cxxabi.h
(__base_class_info): Change to __base_class_type_info. 2.9.5p6c
(__base_class_info::__base): Change to __base_type. 2.9.5p6c
(__base_class_info::offset_shift): Change to __offset_shift. 2.9.5p6c
(__vmi_class_type_info::__base_info): Don't make const, of type
__base_class_type_info, as per 2.9.5p6c
(__pbase_type_info::__qualifier_flags): Change to __flags, as per
2.9.5p7.
(__pbase_type_info::__qualifier_masks): Change to __masks, as per
2.9.5p7.
(__pointer_to_member_type_info::__context_class): Change member to
__context, as per 2.9.5p9.
* libsupc++/tinfo2.cc (__pointer_catch): Change __context_class to
__context.
* libsupc++/tinfo2.cc (__do_catch): Change __qualifier_flags to
__flags.
* libsupc++/tinfo.cc (__do_find_public_src): Change __base to
__base_type.
* libsupc++/tinfo.cc (__do_dyncast): Same.
* libsupc++/tinfo.cc (__do_upcast): Same.
2002-07-31 Benjamin Kosnik <bkoz@redhat.com>
* src/fstream.cc: Add _GLIBCPP_USE_WCHAR_T guards.
2002-07-31 Simon Whomsley <whomsley@avacadcam.com>
......
// new abi support -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of GNU CC.
//
......@@ -117,7 +117,7 @@ class __pbase_type_info
{
/* abi defined member variables */
public:
unsigned int __qualifier_flags; /* qualification of the target object */
unsigned int __flags; /* qualification of the target object */
const std::type_info *__pointee; /* type of pointed to object */
/* abi defined member functions */
......@@ -127,12 +127,12 @@ public:
explicit __pbase_type_info (const char *__n,
int __quals,
const std::type_info *__type)
: std::type_info (__n), __qualifier_flags (__quals), __pointee (__type)
: std::type_info (__n), __flags (__quals), __pointee (__type)
{ }
/* implementation defined types */
public:
enum __qualifier_masks {
enum __masks {
__const_mask = 0x1,
__volatile_mask = 0x2,
__restrict_mask = 0x4,
......@@ -181,7 +181,7 @@ class __pointer_to_member_type_info
{
/* abi defined member variables */
public:
__class_type_info *__context_class; /* class of the member */
__class_type_info *__context; /* class of the member */
/* abi defined member functions */
public:
......@@ -191,7 +191,7 @@ public:
int __quals,
const std::type_info *__type,
__class_type_info *__klass)
: __pbase_type_info (__n, __quals, __type), __context_class (__klass)
: __pbase_type_info (__n, __quals, __type), __context (__klass)
{ }
/* implementation defined member functions */
......@@ -204,11 +204,11 @@ protected:
class __class_type_info;
/* helper class for __vmi_class_type */
class __base_class_info
class __base_class_type_info
{
/* abi defined member variables */
public:
const __class_type_info *__base; /* base class type */
const __class_type_info* __base_type; /* base class type */
long __offset_flags; /* offset and info */
/* implementation defined types */
......@@ -217,7 +217,7 @@ public:
__virtual_mask = 0x1,
__public_mask = 0x2,
hwm_bit = 2,
offset_shift = 8 /* bits to shift offset by */
__offset_shift = 8 /* bits to shift offset by */
};
/* implementation defined member functions */
......@@ -230,7 +230,7 @@ public:
{
// 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__> (__offset_flags) >> offset_shift;
return static_cast<__PTRDIFF_TYPE__> (__offset_flags) >> __offset_shift;
}
};
......@@ -259,9 +259,9 @@ public:
/* 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_mask = 1 << __base_class_info::hwm_bit, /* contained within us */
__contained_virtual_mask = __base_class_type_info::__virtual_mask, /* via a virtual path */
__contained_public_mask = __base_class_type_info::__public_mask, /* via a public path */
__contained_mask = 1 << __base_class_type_info::hwm_bit, /* contained within us */
__contained_private = __contained_mask,
__contained_public = __contained_mask | __contained_public_mask
......@@ -365,7 +365,7 @@ class __vmi_class_type_info : public __class_type_info {
public:
unsigned int __flags; /* details about the class hierarchy */
unsigned int __base_count; /* number of direct bases */
__base_class_info const __base_info[1]; /* array of bases */
__base_class_type_info __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. */
......
......@@ -312,7 +312,7 @@ __do_find_public_src (ptrdiff_t src2dst,
}
base = convert_to_base (base, is_virtual, offset);
__sub_kind base_kind = __base_info[i].__base->__do_find_public_src
__sub_kind base_kind = __base_info[i].__base_type->__do_find_public_src
(src2dst, base, src_type, src_ptr);
if (contained_p (base_kind))
{
......@@ -449,7 +449,7 @@ __do_dyncast (ptrdiff_t src2dst,
}
bool result2_ambig
= __base_info[i].__base->__do_dyncast (src2dst, base_access,
= __base_info[i].__base_type->__do_dyncast (src2dst, base_access,
dst_type, base,
src_type, src_ptr, result2);
result.whole2src = __sub_kind (result.whole2src | result2.whole2src);
......@@ -633,10 +633,10 @@ __do_upcast (const __class_type_info *dst, const void *obj_ptr,
if (base)
base = convert_to_base (base, is_virtual, offset);
if (__base_info[i].__base->__do_upcast (dst, base, result2))
if (__base_info[i].__base_type->__do_upcast (dst, base, result2))
{
if (result2.base_type == nonvirtual_base_type && is_virtual)
result2.base_type = __base_info[i].__base;
result2.base_type = __base_info[i].__base_type;
if (contained_p (result2.part2dst) && !is_public)
result2.part2dst = __sub_kind (result2.part2dst & ~__contained_public_mask);
......
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001
// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation
//
// This file is part of GNU CC.
......@@ -116,11 +116,11 @@ __do_catch (const type_info *thr_type,
const __pbase_type_info *thrown_type =
static_cast <const __pbase_type_info *> (thr_type);
if (thrown_type->__qualifier_flags & ~__qualifier_flags)
if (thrown_type->__flags & ~__flags)
// We're less qualified.
return false;
if (!(__qualifier_flags & __const_mask))
if (!(__flags & __const_mask))
outer &= ~1;
return __pointer_catch (thrown_type, thr_obj, outer);
......@@ -158,7 +158,7 @@ __pointer_catch (const __pbase_type_info *thr_type,
const __pointer_to_member_type_info *thrown_type =
static_cast <const __pointer_to_member_type_info *> (thr_type);
if (*__context_class != *thrown_type->__context_class)
if (*__context != *thrown_type->__context)
return false; // not pointers to member of same class
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment