This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ia64 c++ abi exception handling
- To: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Subject: Re: ia64 c++ abi exception handling
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Mon, 12 Mar 2001 18:01:05 -0800
Richard, your modified patch is fine with me. Thanks. The pragma
interface bits are tangential to your patch.
We're basically talking about three files here:
%grep interface *
grep: CVS: Is a directory
exception:#pragma interface "exception"
new:#pragma interface "new"
tinfo.cc:// this is the external interface to the dynamic cast machinery
typeinfo:#pragma interface "typeinfo"
typeinfo: // the public interface
typeinfo: // the internal interface
So <new>, <typeinfo>, and <exception>.
> Unfortunately, there's still no better way to deal with duplicated
> vtables on targets that don't support COMDAT. The first virtual
> function heuristic doesn't work for all classes. bad_exception, for
> instance.
I mean removing the definitions from the headers files so that there
will be no vtable emitted in the first place.
Here:
2001-03-12 Benjamin Kosnik <bkoz@redhat.com>
* libsupc++/new: Remove pragma interface.
* libsupc++/typeinfo: Same.
* libsupc++/exception: Same.
* libsupc++/new_handler.cc: Remove pragma implementation.
(bad_alloc::what()): Add.
* libsupc++/exception_support.cc: Same.
(exception::~exception): Add.
(bad_exception::~bad_exception): Add.
* libsupc++/tinfo.cc: Same.
(bad_cast::~bad_cast): Add.
(bad_typeid::~bad_typeid): Add.
Index: libsupc++/exception
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/exception,v
retrieving revision 1.3
diff -c -p -r1.3 exception
*** exception 2001/02/16 00:43:41 1.3
--- exception 2001/03/13 01:50:52
***************
*** 31,38 ****
#ifndef __EXCEPTION__
#define __EXCEPTION__
- #pragma interface "exception"
-
extern "C++" {
namespace std
--- 31,36 ----
*************** namespace std
*** 41,47 ****
{
public:
exception() throw() { }
! virtual ~exception() throw() { }
virtual const char* what() const throw();
};
--- 39,45 ----
{
public:
exception() throw() { }
! virtual ~exception() throw();
virtual const char* what() const throw();
};
*************** namespace std
*** 49,55 ****
{
public:
bad_exception() throw() { }
! virtual ~bad_exception() throw() { }
};
typedef void (*terminate_handler) ();
--- 47,53 ----
{
public:
bad_exception() throw() { }
! virtual ~bad_exception() throw();
};
typedef void (*terminate_handler) ();
Index: libsupc++/exception_support.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/exception_support.cc,v
retrieving revision 1.10
diff -c -p -r1.10 exception_support.cc
*** exception_support.cc 2001/02/16 01:26:14 1.10
--- exception_support.cc 2001/03/13 01:50:52
***************
*** 29,36 ****
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
- #pragma implementation "exception"
-
#include "typeinfo"
#include "exception"
#include <cstddef>
--- 29,34 ----
*************** std::uncaught_exception() throw()
*** 377,382 ****
--- 375,388 ----
return p && ! p->caught;
}
+ std::exception::~exception() throw() { }
+
+ std::bad_exception::~bad_exception() throw() { }
+
const char*
std::exception::what() const throw()
{ return typeid (*this).name (); }
+
+
+
+
Index: libsupc++/new
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/new,v
retrieving revision 1.3
diff -c -p -r1.3 new
*** new 2001/02/07 20:26:24 1.3
--- new 2001/03/13 01:50:52
***************
*** 31,37 ****
#ifndef __NEW__
#define __NEW__
- #pragma interface "new"
#include <cstddef>
#include <exception>
--- 31,36 ----
*************** namespace std
*** 42,48 ****
class bad_alloc : public exception
{
public:
! virtual const char* what() const throw() { return "bad_alloc"; }
};
struct nothrow_t { };
--- 41,47 ----
class bad_alloc : public exception
{
public:
! virtual const char* what() const throw();
};
struct nothrow_t { };
Index: libsupc++/new_handler.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/new_handler.cc,v
retrieving revision 1.2
diff -c -p -r1.2 new_handler.cc
*** new_handler.cc 2001/02/16 00:43:41 1.2
--- new_handler.cc 2001/03/13 01:50:52
***************
*** 28,34 ****
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
- #pragma implementation "new"
#include "new"
const std::nothrow_t std::nothrow = { };
--- 28,33 ----
*************** std::set_new_handler (new_handler handle
*** 43,45 ****
--- 42,48 ----
__new_handler = handler;
return prev_handler;
}
+
+ const char*
+ std::bad_alloc::what() const throw()
+ { return "bad_alloc"; }
Index: libsupc++/tinfo.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/tinfo.cc,v
retrieving revision 1.5
diff -c -p -r1.5 tinfo.cc
*** tinfo.cc 2001/02/16 01:26:14 1.5
--- tinfo.cc 2001/03/13 01:50:56
***************
*** 27,34 ****
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
- #pragma implementation "typeinfo"
-
#include <cstddef>
#include "tinfo.h"
#include "new" // for placement new
--- 27,32 ----
***************
*** 40,45 ****
--- 38,46 ----
std::type_info::
~type_info ()
{ }
+
+ std::bad_cast::~bad_cast() throw() { }
+ std::bad_typeid::~bad_typeid() throw() { }
#if !__GXX_MERGED_TYPEINFO_NAMES
Index: libsupc++/typeinfo
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/typeinfo,v
retrieving revision 1.5
diff -c -p -r1.5 typeinfo
*** typeinfo 2001/02/16 01:26:14 1.5
--- typeinfo 2001/03/13 01:50:56
***************
*** 30,37 ****
#ifndef __TYPEINFO__
#define __TYPEINFO__
- #pragma interface "typeinfo"
-
#include <exception>
extern "C++" {
--- 30,35 ----
*************** namespace std
*** 118,131 ****
{
public:
bad_cast() throw() { }
! virtual ~bad_cast() throw() { }
};
class bad_typeid : public exception
{
public:
bad_typeid () throw() { }
! virtual ~bad_typeid () throw() { }
};
} // namespace std
--- 116,129 ----
{
public:
bad_cast() throw() { }
! virtual ~bad_cast() throw();
};
class bad_typeid : public exception
{
public:
bad_typeid () throw() { }
! virtual ~bad_typeid () throw();
};
} // namespace std