Commit e65d7eac by Nathan Sidwell Committed by Nathan Sidwell

cxxabi.h (__pbase_type_info): Define, based on __pointer_type_info.

	* inc/cxxabi.h (__pbase_type_info): Define, based on
	__pointer_type_info.
	(__pointer_type_info): Derive from __pbase_type_info. Adjust.
	(__pointer_to_member_type_info): Likewise.
	* tinfo2.cc (__pbase_type_info::~__pbase_type_info): Implement.
	(__pointer_to_member_type_info::__is_pointer_p): Remove.
	(__pointer_type_info::__do_catch): Rename to ...
	(__pbase_type_info::__do_catch): ... here. Adjust.
	(__pbase_type_info::__pointer_catch): Implement.
	(__pointer_type_info::__pointer_catch): Adjust.
	(__pointer_to_member_type_info::__pointer_catch): Adjust.

From-SVN: r34165
parent bebc2c61
2000-05-25 Nathan Sidwell <nathan@codesourcery.com>
* inc/cxxabi.h (__pbase_type_info): Define, based on
__pointer_type_info.
(__pointer_type_info): Derive from __pbase_type_info. Adjust.
(__pointer_to_member_type_info): Likewise.
* tinfo2.cc (__pbase_type_info::~__pbase_type_info): Implement.
(__pointer_to_member_type_info::__is_pointer_p): Remove.
(__pointer_type_info::__do_catch): Rename to ...
(__pbase_type_info::__do_catch): ... here. Adjust.
(__pbase_type_info::__pointer_catch): Implement.
(__pointer_type_info::__pointer_catch): Adjust.
(__pointer_to_member_type_info::__pointer_catch): Adjust.
2000-05-25 Nathan Sidwell <nathan@codesourcery.com>
* tinfo.h (__user_type_info::contained_virtual_p): New
predicate.
* tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond
......
......@@ -73,8 +73,51 @@ public:
{ }
};
/* type information for pointer to data or function, but not pointer to member */
class __pointer_type_info
/* type information for array objects */
class __array_type_info
: public std::type_info
{
/* abi defined member functions */
protected:
virtual ~__array_type_info ();
public:
explicit __array_type_info (const char *__n)
: std::type_info (__n)
{ }
};
/* type information for functions (both member and non-member) */
class __function_type_info
: public std::type_info
{
/* abi defined member functions */
public:
virtual ~__function_type_info ();
public:
explicit __function_type_info (const char *__n)
: std::type_info (__n)
{ }
/* implementation defined member functions */
protected:
virtual bool __is_function_p () const;
};
/* type information for enumerations */
class __enum_type_info
: public std::type_info
{
/* abi defined member functions */
public:
virtual ~__enum_type_info ();
public:
explicit __enum_type_info (const char *__n)
: std::type_info (__n)
{ }
};
/* common type information for simple pointers and pointers to member */
class __pbase_type_info
: public std::type_info
{
/* abi defined member variables */
......@@ -84,9 +127,9 @@ public:
/* abi defined member functions */
public:
virtual ~__pointer_type_info ();
virtual ~__pbase_type_info ();
public:
explicit __pointer_type_info (const char *__n,
explicit __pbase_type_info (const char *__n,
int __quals,
const std::type_info *__type)
: std::type_info (__n), quals (__quals), type (__type)
......@@ -104,63 +147,42 @@ public:
/* implementation defined member functions */
protected:
virtual bool __is_pointer_p () const;
protected:
virtual bool __do_catch (const std::type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
protected:
virtual bool __pointer_catch (const __pointer_type_info *__thr_type,
inline virtual bool __pointer_catch (const __pbase_type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
};
/* type information for array objects */
class __array_type_info
: public std::type_info
{
/* abi defined member functions */
protected:
virtual ~__array_type_info ();
public:
explicit __array_type_info (const char *__n)
: std::type_info (__n)
{ }
};
/* type information for functions (both member and non-member) */
class __function_type_info
: public std::type_info
/* type information for simple pointers */
class __pointer_type_info
: public __pbase_type_info
{
/* abi defined member functions */
public:
virtual ~__function_type_info ();
virtual ~__pointer_type_info ();
public:
explicit __function_type_info (const char *__n)
: std::type_info (__n)
explicit __pointer_type_info (const char *__n,
int __quals,
const std::type_info *__type)
: __pbase_type_info (__n, __quals, __type)
{ }
/* implementation defined member functions */
protected:
virtual bool __is_function_p () const;
};
virtual bool __is_pointer_p () const;
/* type information for enumerations */
class __enum_type_info
: public std::type_info
{
/* abi defined member functions */
public:
virtual ~__enum_type_info ();
public:
explicit __enum_type_info (const char *__n)
: std::type_info (__n)
{ }
protected:
virtual bool __pointer_catch (const __pbase_type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
};
/* type information for a pointer to member variable (not function) */
/* type information for a pointer to member variable */
class __pointer_to_member_type_info
: public __pointer_type_info
: public __pbase_type_info
{
/* abi defined member variables */
public:
......@@ -174,14 +196,12 @@ public:
int __quals,
const std::type_info *__type,
const __class_type_info *__klass)
: __pointer_type_info (__n, __quals, __type), klass (__klass)
: __pbase_type_info (__n, __quals, __type), klass (__klass)
{ }
/* implementation defined member functions */
protected:
virtual bool __is_pointer_p () const;
protected:
virtual bool __pointer_catch (const __pointer_type_info *__thr_type,
virtual bool __pointer_catch (const __pbase_type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
};
......
......@@ -108,10 +108,6 @@ __fundamental_type_info::
~__fundamental_type_info ()
{}
__pointer_type_info::
~__pointer_type_info ()
{}
__array_type_info::
~__array_type_info ()
{}
......@@ -124,6 +120,14 @@ __enum_type_info::
~__enum_type_info ()
{}
__pbase_type_info::
~__pbase_type_info ()
{}
__pointer_type_info::
~__pointer_type_info ()
{}
__pointer_to_member_type_info::
~__pointer_to_member_type_info ()
{}
......@@ -140,14 +144,7 @@ __is_function_p () const
return true;
}
bool __pointer_to_member_type_info::
__is_pointer_p () const
{
return false;
}
bool __pointer_type_info::
bool __pbase_type_info::
__do_catch (const type_info *thr_type,
void **thr_obj,
unsigned outer) const
......@@ -163,8 +160,8 @@ __do_catch (const type_info *thr_type,
// But for that to be valid, our outer pointers must be const qualified.
return false;
const __pointer_type_info *thrown_type =
static_cast <const __pointer_type_info *> (thr_type);
const __pbase_type_info *thrown_type =
static_cast <const __pbase_type_info *> (thr_type);
if (thrown_type->quals & ~quals)
// We're less qualified.
......@@ -176,8 +173,16 @@ __do_catch (const type_info *thr_type,
return __pointer_catch (thrown_type, thr_obj, outer);
}
inline bool __pbase_type_info::
__pointer_catch (const __pbase_type_info *thrown_type,
void **thr_obj,
unsigned outer) const
{
return type->__do_catch (thrown_type->type, thr_obj, outer + 2);
}
bool __pointer_type_info::
__pointer_catch (const __pointer_type_info *thrown_type,
__pointer_catch (const __pbase_type_info *thrown_type,
void **thr_obj,
unsigned outer) const
{
......@@ -187,11 +192,11 @@ __pointer_catch (const __pointer_type_info *thrown_type,
return !thrown_type->type->__is_function_p ();
}
return type->__do_catch (thrown_type->type, thr_obj, outer + 2);
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
}
bool __pointer_to_member_type_info::
__pointer_catch (const __pointer_type_info *thr_type,
__pointer_catch (const __pbase_type_info *thr_type,
void **thr_obj,
unsigned outer) const
{
......@@ -203,7 +208,7 @@ __pointer_catch (const __pointer_type_info *thr_type,
if (*klass != *thrown_type->klass)
return false; // not pointers to member of same class
return type->__do_catch (thrown_type->type, thr_obj, outer + 2);
return __pbase_type_info::__pointer_catch (thrown_type, thr_obj, outer);
}
} // namespace std
......
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