summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-24 07:59:41 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-24 07:59:41 +0000
commit4880ab993a8a6716dfb990ae93da777025169e9b (patch)
tree30f00d7a2377783a5112afcd6c22c5508f1c6309 /gcc/cp/cp-tree.h
parent21108847f90c8492c8238e9ea2344ac50b015898 (diff)
downloadgcc-4880ab993a8a6716dfb990ae93da777025169e9b.tar.gz
cp:
PR c++/12698, c++/12699, c++/12700, c++/12566 * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. (debug_class, debug_thunks): New. * class.c (dump_class_hierarchy_1): New break out from ... (dump_class_hierarchy): ... here. (dump_thunk, debug_thunks, debug_class): New. (update_vtable_entry_for_fn): Add ssizetype casts. Correct continued search for primary binfo via virtual. (build_vtbl_initializer): Follow covariant thunk alias. * method.c (make_thunk): Clear DECL_THUNKS of the thunk. (finish_thunk): Look for an alias of the covariant thunk and point to it. (use_thunk): We should never use an alias. * semantics.c (emit_associated_thunks): Do not emit aliases. PR c++/12566 * cp-tree.h (cp_fname_init): Add TYPE pointer param. * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't create an ad-hoc ERROR_MARK. (cp_make_fname_decl): Adjust. * pt.c (tsubst_expr): Adjust. testsuite: PR c++/12698, c++/12699, c++/12700, c++/12566 * g++.dg/inherit/covariant9.C: New test. * g++.dg/inherit/covariant10.C: New test. * g++.dg/inherit/covariant11.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72882 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 2812a90dff3..06031600239 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2855,7 +2855,11 @@ struct lang_decl GTY(())
The constant adjustment is given by THUNK_FIXED_OFFSET. If the
vcall or vbase offset is required, the index into the vtable is given by
- THUNK_VIRTUAL_OFFSET. */
+ THUNK_VIRTUAL_OFFSET.
+
+ Due to ordering constraints in class layout, it is possible to have
+ equivalent covariant thunks. THUNK_ALIAS_P and THUNK_ALIAS are used
+ in those cases. */
/* An integer indicating how many bytes should be subtracted from the
this or result pointer when this function is called. */
@@ -2868,13 +2872,21 @@ struct lang_decl GTY(())
binfo of the relevant virtual base. If NULL, then there is no
virtual adjust. (The vptr is always located at offset zero from
the this or result pointer.) (If the covariant type is within the
- class hierarchy being layed out, the vbase index is not yet known
+ class hierarchy being laid out, the vbase index is not yet known
at the point we need to create the thunks, hence the need to use
binfos.) */
#define THUNK_VIRTUAL_OFFSET(DECL) \
(LANG_DECL_U2_CHECK (VAR_OR_FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset)
+/* A thunk which is equivalent to another thunk. */
+#define THUNK_ALIAS_P(DECL) \
+ (THUNK_VIRTUAL_OFFSET (DECL) && DECL_P (THUNK_VIRTUAL_OFFSET (DECL)))
+
+/* When THUNK_ALIAS_P is true, this indicates the thunk which is
+ aliased. */
+#define THUNK_ALIAS(DECL) THUNK_VIRTUAL_OFFSET (DECL)
+
/* For thunk NODE, this is the FUNCTION_DECL thunked to. */
#define THUNK_TARGET(NODE) \
(DECL_LANG_SPECIFIC (NODE)->u.f.befriending_classes)
@@ -3566,6 +3578,8 @@ extern void note_name_declared_in_class (tree, tree);
extern tree get_vtbl_decl_for_binfo (tree);
extern tree get_vtt_name (tree);
extern tree get_primary_binfo (tree);
+extern void debug_class (tree);
+extern void debug_thunks (tree);
/* in cvt.c */
extern tree convert_to_reference (tree, tree, int, int, tree);
@@ -3681,7 +3695,7 @@ extern int nonstatic_local_decl_p (tree);
extern tree declare_global_var (tree, tree);
extern void register_dtor_fn (tree);
extern tmpl_spec_kind current_tmpl_spec_kind (int);
-extern tree cp_fname_init (const char *);
+extern tree cp_fname_init (const char *, tree *);
extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
extern tree cxx_builtin_type_decls (void);
extern void warn_extern_redeclared_static (tree, tree);