]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (init_decl_processing): Correct name of pure virtual function under the new...
authorMark Mitchell <mark@codesourcery.com>
Sun, 19 Nov 2000 21:07:24 +0000 (21:07 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 19 Nov 2000 21:07:24 +0000 (21:07 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/rtti.c
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/exception_support.cc
libstdc++-v3/libsupc++/pure.cc

index 0fb019deda48eb1334b94a6156c91b01917aeeda..7886ddca74ae17b4f8923930975d6da586cc9c72 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * decl.c (grokparms): Don't even function types of `void' type,
index d6419303c2ca4804dcf3f81c60fffa2d95dadfb5..380b734551e322b02def3fea98424f4daccc3b34 100644 (file)
@@ -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 ();
index f172c5fe66764bdf553c6535205c48676ebcb9e8..3a54fc4753d42ca474f7e1296153be9f241f92d0 100644 (file)
@@ -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
index 64aed389d70d8fb0ca73b35b510ec9e11b5f8855..bec0beae1b7ce5a27d9f86248e99a590382907c0 100644 (file)
@@ -1,3 +1,11 @@
+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>
 
        * libsupc++/exception_support.h: New header file.
index ace0927cc1f84bd37388256840846c224b0de550..42958744707c7a75009876f1370ef5c5ce7a05fc 100644 (file)
@@ -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);
index c217d8aac5a6317e641e9fe8b4904eab2289ae35..7ada0666856a6fe90fc8c9ce8809c10186be7561 100644 (file)
@@ -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 ();