Commit 2650255a by Mark Mitchell Committed by Mark Mitchell

decl.c (init_decl_processing): Correct name of pure virtual function under the new ABI.

	* decl.c (init_decl_processing): Correct name of pure virtual
	function under the new ABI.
	* rtti.c (throw_bad_cast): Likewise, for bad cast function.
	(throw_bad_typeid): Likewise for bad typeid function.

	* libsupc++/exception_support.cc (__throw_bad_cast): Name it
	__cxa_bad_cast under the new ABI.
	(__throw_bad_typeid): Name it __cxa_bad_typeid under the new ABI.
	* libsupc++/pure.cc (__pure_virtual): Name it __cxa_pure_virtual
	under the new ABI.

From-SVN: r37575
parent b7ac5370
2000-11-19 Mark Mitchell <mark@codesourcery.com>
* decl.c (init_decl_processing): Correct name of pure virtual
function under the new ABI.
* rtti.c (throw_bad_cast): Likewise, for bad cast function.
(throw_bad_typeid): Likewise for bad typeid function.
2000-11-18 Mark Mitchell <mark@codesourcery.com> 2000-11-18 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokparms): Don't even function types of `void' type, * decl.c (grokparms): Don't even function types of `void' type,
......
...@@ -6656,7 +6656,10 @@ init_decl_processing () ...@@ -6656,7 +6656,10 @@ init_decl_processing ()
} }
abort_fndecl abort_fndecl
= build_library_fn_ptr ("__pure_virtual", void_ftype); = build_library_fn_ptr ((flag_new_abi
? "__cxa_pure_virtual"
: "__pure_virtual"),
void_ftype);
/* Perform other language dependent initializations. */ /* Perform other language dependent initializations. */
init_class_processing (); init_class_processing ();
......
...@@ -182,7 +182,9 @@ build_headof (exp) ...@@ -182,7 +182,9 @@ build_headof (exp)
static tree static tree
throw_bad_cast () throw_bad_cast ()
{ {
tree fn = get_identifier ("__throw_bad_cast"); tree fn = get_identifier (flag_new_abi
? "__cxa_bad_cast" :
"__throw_bad_cast");
if (IDENTIFIER_GLOBAL_VALUE (fn)) if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn); fn = IDENTIFIER_GLOBAL_VALUE (fn);
else else
...@@ -195,7 +197,9 @@ throw_bad_cast () ...@@ -195,7 +197,9 @@ throw_bad_cast ()
static tree static tree
throw_bad_typeid () throw_bad_typeid ()
{ {
tree fn = get_identifier ("__throw_bad_typeid"); tree fn = get_identifier (flag_new_abi
? "__cxa_bad_typeid"
: "__throw_bad_typeid");
if (IDENTIFIER_GLOBAL_VALUE (fn)) if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn); fn = IDENTIFIER_GLOBAL_VALUE (fn);
else else
......
2000-11-19 Mark Mitchell <mark@codesourcery.com>
* libsupc++/exception_support.cc (__throw_bad_cast): Name it
__cxa_bad_cast under the new ABI.
(__throw_bad_typeid): Name it __cxa_bad_typeid under the new ABI.
* libsupc++/pure.cc (__pure_virtual): Name it __cxa_pure_virtual
under the new ABI.
2000-11-18 Mark Mitchell <mark@codesourcery.com> 2000-11-18 Mark Mitchell <mark@codesourcery.com>
* libsupc++/exception_support.h: New header file. * libsupc++/exception_support.h: New header file.
......
...@@ -348,15 +348,23 @@ __check_null_eh_spec (void) ...@@ -348,15 +348,23 @@ __check_null_eh_spec (void)
// Helpers for rtti. Although these don't return, we give them return types so // Helpers for rtti. Although these don't return, we give them return types so
// that the type system is not broken. // that the type system is not broken.
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
#define THROW_BAD_CAST __throw_bad_cast
#define THROW_BAD_TYPEID __throw_bad_typeid
#else
#define THROW_BAD_CAST __cxa_bad_cast
#define THROW_BAD_TYPEID __cxa_bad_typeid
#endif
extern "C" void * extern "C" void *
__throw_bad_cast () THROW_BAD_CAST ()
{ {
throw std::bad_cast (); throw std::bad_cast ();
return 0; return 0;
} }
extern "C" std::type_info const & extern "C" std::type_info const &
__throw_bad_typeid () THROW_BAD_TYPEID ()
{ {
throw std::bad_typeid (); throw std::bad_typeid ();
return typeid (void); return typeid (void);
......
...@@ -46,8 +46,16 @@ extern "C" { ...@@ -46,8 +46,16 @@ extern "C" {
extern void __terminate(void) __attribute__ ((__noreturn__)); extern void __terminate(void) __attribute__ ((__noreturn__));
// The name of the function to be placed in vtables in place of a pure
// virtual function is different in the two ABIs.
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
#define PURE_VIRTUAL_NAME __pure_virtual
#else
#define PURE_VIRTUAL_NAME __cxa_pure_virtual
#endif
void void
__pure_virtual (void) PURE_VIRTUAL_NAME (void)
{ {
writestr ("pure virtual method called\n"); writestr ("pure virtual method called\n");
__terminate (); __terminate ();
......
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