aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-01-31 21:27:42 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-01-31 16:27:42 -0500
commitab044c7412113ecafc602f51f0764130c0525666 (patch)
treef5eb4226cefecaedd3b029d94178aae9bd7f81c6
parent5e19c0539080471ad7097fa5c441031334f12bdd (diff)
downloadgcc-ab044c7412113ecafc602f51f0764130c0525666.zip
gcc-ab044c7412113ecafc602f51f0764130c0525666.tar.gz
gcc-ab044c7412113ecafc602f51f0764130c0525666.tar.bz2
tinfo.h (old abi): #include "tconfig.h".
* tinfo.h (old abi): #include "tconfig.h". * tinfo.cc (convert_to_base): Move into old abi section. From-SVN: r31725
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tinfo.cc32
-rw-r--r--gcc/cp/tinfo.h4
3 files changed, 20 insertions, 21 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 50848be..98e2b2f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-31 Jason Merrill <jason@casey.cygnus.com>
+
+ * tinfo.h (old abi): #include "tconfig.h".
+ * tinfo.cc (convert_to_base): Move into old abi section.
+
2000-01-31 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (BINFO_VIRTUALS): Tweak documentation.
diff --git a/gcc/cp/tinfo.cc b/gcc/cp/tinfo.cc
index 557c88c..20e6c9e 100644
--- a/gcc/cp/tinfo.cc
+++ b/gcc/cp/tinfo.cc
@@ -31,12 +31,23 @@
#include "tinfo.h"
#include "new" // for placement new
+// This file contains the minimal working set necessary to link with code
+// that uses virtual functions and -frtti but does not actually use RTTI
+// functionality.
+
+std::type_info::
+~type_info ()
+{ }
+
+#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+// original (old) abi
+
namespace
{
// ADDR is a pointer to an object. Convert it to a pointer to a base,
// using OFFSET.
inline void*
-convert_to_base (void *addr, bool is_virtual, USItype offset)
+convert_to_base (void *addr, bool is_virtual, myint32 offset)
{
if (!addr)
return NULL;
@@ -44,32 +55,13 @@ convert_to_base (void *addr, bool is_virtual, USItype offset)
if (!is_virtual)
return (char *) addr + offset;
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
- // Under the new ABI, the offset gives us an index into the vtable,
- // which contains an offset to the virtual base. The vptr is always
- // the first thing in the object.
- std::ptrdiff_t *vtable = *((std::ptrdiff_t **) addr);
- return ((char *) addr) + vtable[offset];
-#else
// Under the old ABI, the offset gives us the address of a pointer
// to the virtual base.
return *((void **) ((char *) addr + offset));
-#endif
}
}
-// This file contains the minimal working set necessary to link with code
-// that uses virtual functions and -frtti but does not actually use RTTI
-// functionality.
-
-std::type_info::
-~type_info ()
-{ }
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// original (old) abi
-
// We can't rely on common symbols being shared between shared objects.
bool std::type_info::
operator== (const std::type_info& arg) const
diff --git a/gcc/cp/tinfo.h b/gcc/cp/tinfo.h
index 4753e71..3df662d 100644
--- a/gcc/cp/tinfo.h
+++ b/gcc/cp/tinfo.h
@@ -171,6 +171,8 @@ public:
// type_info for a general class.
// Kludge, kludge, kludge.
+#include "tconfig.h"
+
#if BITS_PER_UNIT == 8
typedef int myint32 __attribute__ ((mode (SI)));
#elif BITS_PER_UNIT == 16
@@ -428,6 +430,6 @@ void *__dynamic_cast (const void *src_ptr, // object started from
// -2: src_type is not a public base of dst_type
// -3: src_type is a multiple public non-virtual base of dst_type
-}; // namespace std
+} // namespace std
#endif