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> 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 * tinfo.h (__user_type_info::contained_virtual_p): New
predicate. predicate.
* tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond * tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond
......
...@@ -73,48 +73,6 @@ public: ...@@ -73,48 +73,6 @@ public:
{ } { }
}; };
/* type information for pointer to data or function, but not pointer to member */
class __pointer_type_info
: public std::type_info
{
/* abi defined member variables */
public:
int quals; /* qualification of the target object */
const std::type_info *type; /* type of pointed to object */
/* abi defined member functions */
public:
virtual ~__pointer_type_info ();
public:
explicit __pointer_type_info (const char *__n,
int __quals,
const std::type_info *__type)
: std::type_info (__n), quals (__quals), type (__type)
{ }
/* implementation defined types */
public:
enum quals_masks {
const_mask = 0x1,
volatile_mask = 0x2,
restrict_mask = 0x4,
incomplete_mask = 0x8,
incomplete_class_mask = 0x10
};
/* 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,
void **__thr_obj,
unsigned __outer) const;
};
/* type information for array objects */ /* type information for array objects */
class __array_type_info class __array_type_info
: public std::type_info : public std::type_info
...@@ -158,9 +116,73 @@ public: ...@@ -158,9 +116,73 @@ public:
{ } { }
}; };
/* type information for a pointer to member variable (not function) */ /* common type information for simple pointers and pointers to member */
class __pbase_type_info
: public std::type_info
{
/* abi defined member variables */
public:
int quals; /* qualification of the target object */
const std::type_info *type; /* type of pointed to object */
/* abi defined member functions */
public:
virtual ~__pbase_type_info ();
public:
explicit __pbase_type_info (const char *__n,
int __quals,
const std::type_info *__type)
: std::type_info (__n), quals (__quals), type (__type)
{ }
/* implementation defined types */
public:
enum quals_masks {
const_mask = 0x1,
volatile_mask = 0x2,
restrict_mask = 0x4,
incomplete_mask = 0x8,
incomplete_class_mask = 0x10
};
/* implementation defined member functions */
protected:
virtual bool __do_catch (const std::type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
protected:
inline virtual bool __pointer_catch (const __pbase_type_info *__thr_type,
void **__thr_obj,
unsigned __outer) const;
};
/* type information for simple pointers */
class __pointer_type_info
: public __pbase_type_info
{
/* abi defined member functions */
public:
virtual ~__pointer_type_info ();
public:
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_pointer_p () const;
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 */
class __pointer_to_member_type_info class __pointer_to_member_type_info
: public __pointer_type_info : public __pbase_type_info
{ {
/* abi defined member variables */ /* abi defined member variables */
public: public:
...@@ -174,14 +196,12 @@ public: ...@@ -174,14 +196,12 @@ public:
int __quals, int __quals,
const std::type_info *__type, const std::type_info *__type,
const __class_type_info *__klass) 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 */ /* implementation defined member functions */
protected: protected:
virtual bool __is_pointer_p () const; virtual bool __pointer_catch (const __pbase_type_info *__thr_type,
protected:
virtual bool __pointer_catch (const __pointer_type_info *__thr_type,
void **__thr_obj, void **__thr_obj,
unsigned __outer) const; unsigned __outer) const;
}; };
......
...@@ -108,10 +108,6 @@ __fundamental_type_info:: ...@@ -108,10 +108,6 @@ __fundamental_type_info::
~__fundamental_type_info () ~__fundamental_type_info ()
{} {}
__pointer_type_info::
~__pointer_type_info ()
{}
__array_type_info:: __array_type_info::
~__array_type_info () ~__array_type_info ()
{} {}
...@@ -124,6 +120,14 @@ __enum_type_info:: ...@@ -124,6 +120,14 @@ __enum_type_info::
~__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::
~__pointer_to_member_type_info () ~__pointer_to_member_type_info ()
{} {}
...@@ -140,14 +144,7 @@ __is_function_p () const ...@@ -140,14 +144,7 @@ __is_function_p () const
return true; return true;
} }
bool __pointer_to_member_type_info:: bool __pbase_type_info::
__is_pointer_p () const
{
return false;
}
bool __pointer_type_info::
__do_catch (const type_info *thr_type, __do_catch (const type_info *thr_type,
void **thr_obj, void **thr_obj,
unsigned outer) const unsigned outer) const
...@@ -163,8 +160,8 @@ __do_catch (const type_info *thr_type, ...@@ -163,8 +160,8 @@ __do_catch (const type_info *thr_type,
// But for that to be valid, our outer pointers must be const qualified. // But for that to be valid, our outer pointers must be const qualified.
return false; return false;
const __pointer_type_info *thrown_type = const __pbase_type_info *thrown_type =
static_cast <const __pointer_type_info *> (thr_type); static_cast <const __pbase_type_info *> (thr_type);
if (thrown_type->quals & ~quals) if (thrown_type->quals & ~quals)
// We're less qualified. // We're less qualified.
...@@ -176,8 +173,16 @@ __do_catch (const type_info *thr_type, ...@@ -176,8 +173,16 @@ __do_catch (const type_info *thr_type,
return __pointer_catch (thrown_type, thr_obj, outer); 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:: bool __pointer_type_info::
__pointer_catch (const __pointer_type_info *thrown_type, __pointer_catch (const __pbase_type_info *thrown_type,
void **thr_obj, void **thr_obj,
unsigned outer) const unsigned outer) const
{ {
...@@ -187,11 +192,11 @@ __pointer_catch (const __pointer_type_info *thrown_type, ...@@ -187,11 +192,11 @@ __pointer_catch (const __pointer_type_info *thrown_type,
return !thrown_type->type->__is_function_p (); 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:: 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, void **thr_obj,
unsigned outer) const unsigned outer) const
{ {
...@@ -203,7 +208,7 @@ __pointer_catch (const __pointer_type_info *thr_type, ...@@ -203,7 +208,7 @@ __pointer_catch (const __pointer_type_info *thr_type,
if (*klass != *thrown_type->klass) if (*klass != *thrown_type->klass)
return false; // not pointers to member of same class 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 } // 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