From: Mark Mitchell Date: Sun, 19 Nov 2000 21:07:24 +0000 (+0000) Subject: decl.c (init_decl_processing): Correct name of pure virtual function under the new... X-Git-Tag: prereleases/libstdc++-2.92~2891 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2650255a57477be0a966f3d3af0c0b71a0e52f0f;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0fb019deda48..7886ddca74ae 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2000-11-19 Mark Mitchell + + * 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 * decl.c (grokparms): Don't even function types of `void' type, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d6419303c2ca..380b734551e3 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6656,7 +6656,10 @@ init_decl_processing () } 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. */ init_class_processing (); diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index f172c5fe6676..3a54fc4753d4 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -182,7 +182,9 @@ build_headof (exp) static tree 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)) fn = IDENTIFIER_GLOBAL_VALUE (fn); else @@ -195,7 +197,9 @@ throw_bad_cast () static tree 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)) fn = IDENTIFIER_GLOBAL_VALUE (fn); else diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 64aed389d70d..bec0beae1b7c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2000-11-19 Mark Mitchell + + * 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 * libsupc++/exception_support.h: New header file. diff --git a/libstdc++-v3/libsupc++/exception_support.cc b/libstdc++-v3/libsupc++/exception_support.cc index ace0927cc1f8..42958744707c 100644 --- a/libstdc++-v3/libsupc++/exception_support.cc +++ b/libstdc++-v3/libsupc++/exception_support.cc @@ -348,15 +348,23 @@ __check_null_eh_spec (void) // Helpers for rtti. Although these don't return, we give them return types so // 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 * -__throw_bad_cast () +THROW_BAD_CAST () { throw std::bad_cast (); return 0; } extern "C" std::type_info const & -__throw_bad_typeid () +THROW_BAD_TYPEID () { throw std::bad_typeid (); return typeid (void); diff --git a/libstdc++-v3/libsupc++/pure.cc b/libstdc++-v3/libsupc++/pure.cc index c217d8aac5a6..7ada0666856a 100644 --- a/libstdc++-v3/libsupc++/pure.cc +++ b/libstdc++-v3/libsupc++/pure.cc @@ -46,8 +46,16 @@ extern "C" { 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 -__pure_virtual (void) +PURE_VIRTUAL_NAME (void) { writestr ("pure virtual method called\n"); __terminate ();