diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1996-10-11 20:20:29 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-10-11 20:20:29 +0000 |
commit | 1cd56e0ee6260f72d90a4eee3397e2bd158771cf (patch) | |
tree | ccbcbf2bf24b37f3b00fd08715662e22b05a9706 | |
parent | d22c85969b4555d97d16a2f6704bf57b7d712cd3 (diff) | |
download | gcc-1cd56e0ee6260f72d90a4eee3397e2bd158771cf.zip gcc-1cd56e0ee6260f72d90a4eee3397e2bd158771cf.tar.gz gcc-1cd56e0ee6260f72d90a4eee3397e2bd158771cf.tar.bz2 |
Initial revision
From-SVN: r12954
-rw-r--r-- | gcc/cp/tinfo.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/cp/tinfo.h b/gcc/cp/tinfo.h new file mode 100644 index 0000000..3df55a5 --- /dev/null +++ b/gcc/cp/tinfo.h @@ -0,0 +1,55 @@ +// RTTI support internals for -*- C++ -*- +// Copyright (C) 1994, 1995, 1996 Free Software Foundation + +#include "typeinfo" + +// Class declarations shared between the typeinfo implementation files. + +// type_info for a class with no base classes (or an enum). + +struct __user_type_info : public type_info { + __user_type_info (const char *n) : type_info (n) {} + + // If our type can be converted to the desired type, + // return the pointer, adjusted accordingly; else return 0. + virtual void* dcast (const type_info &, int, void *, + const type_info * = 0, void * = 0) const; +}; + +// type_info for a class with one public, nonvirtual base class. + +class __si_type_info : public __user_type_info { + const __user_type_info &base; + +public: + __si_type_info (const char *n, const __user_type_info &b) + : __user_type_info (n), base (b) { } + + virtual void *dcast (const type_info &, int, void *, + const type_info * = 0, void * = 0) const; +}; + +// type_info for a general class. + +typedef unsigned int USItype __attribute__ ((mode (SI))); + +struct __class_type_info : public __user_type_info { + enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 }; + + struct base_info { + const __user_type_info *base; + USItype offset: 29; + bool is_virtual: 1; + access access: 2; + }; + + const base_info *base_list; + size_t n_bases; + + __class_type_info (const char *name, const base_info *bl, size_t bn) + : __user_type_info (name), base_list (bl), n_bases (bn) {} + + // This is a little complex. + virtual void* dcast (const type_info &, int, void *, + const type_info * = 0, void * = 0) const; +}; |