From 311862c8bed5ff4d37ae5e5e2fab91e7b69bab8b Mon Sep 17 00:00:00 2001 From: Gerald Baumgartner Date: Fri, 8 Jul 1994 20:22:37 +0000 Subject: [PATCH] partial merge for isgnature stuff From-SVN: r7680 --- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/cp-tree.h | 1 + gcc/cp/decl2.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- gcc/cp/sig.c | 1 + 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d0f869cd780..af52a29a21e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +Thu Jul 7 22:20:46 1994 Gerald Baumgartner (gb@andros.cygnus.com) + + * cp-tree.h (walk_sigtables): Created extern declaration. + * decl2.c (walk_sigtables): Created function, patterned after + walk_vtables, even though we only need it to write out sigtables. + (finish_sigtable_vardecl): Created function. + (finish_vtable_vardecl): Changed 0 to NULL_PTR. + (finish_file): Call walk_sigtables. + + * sig.c (build_signature_table_constructor): Mark class member + function pointed to from signature table entry as addressable. + Wed Jul 6 20:25:48 1994 Mike Stump (mrs@cygnus.com) * except.c (init_exception_processing): Setup interim_eh_hook to diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f6891e8fb26..3eb25cf6790 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1984,6 +1984,7 @@ extern void finish_builtin_type PROTO((tree, char *, tree *, int, tree)); extern tree coerce_new_type PROTO((tree)); extern tree coerce_delete_type PROTO((tree)); extern void walk_vtables PROTO((void (*)(), void (*)())); +extern void walk_sigtables PROTO((void (*)(), void (*)())); extern void finish_file PROTO((void)); extern void warn_if_unknown_interface PROTO((void)); extern tree grok_x_components PROTO((tree, tree)); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 80bb62aee5c..31a24756d37 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2439,7 +2439,7 @@ finish_vtable_vardecl (prev, vars) } #endif /* DWARF_DEBUGGING_INFO */ - rest_of_decl_compilation (vars, 0, 1, 1); + rest_of_decl_compilation (vars, NULL_PTR, 1, 1); } else if (TREE_USED (vars) && flag_vtable_thunks) assemble_external (vars); @@ -2474,6 +2474,48 @@ walk_vtables (typedecl_fn, vardecl_fn) } } +static void +finish_sigtable_vardecl (prev, vars) + tree prev, vars; +{ + /* We don't need to mark sigtable entries as addressable here as is done + for vtables. Since sigtables, unlike vtables, are always written out, + that was already done in build_signature_table_constructor. */ + + rest_of_decl_compilation (vars, NULL_PTR, 1, 1); + + /* We know that PREV must be non-zero here. */ + TREE_CHAIN (prev) = TREE_CHAIN (vars); +} + +void +walk_sigtables (typedecl_fn, vardecl_fn) + register void (*typedecl_fn)(); + register void (*vardecl_fn)(); +{ + tree prev, vars; + + for (prev = 0, vars = getdecls (); vars; vars = TREE_CHAIN (vars)) + { + register tree type = TREE_TYPE (vars); + + if (TREE_CODE (vars) == TYPE_DECL + && type != error_mark_node + && IS_SIGNATURE (type)) + { + if (typedecl_fn) (*typedecl_fn) (prev, vars); + } + else if (TREE_CODE (vars) == VAR_DECL + && TREE_TYPE (vars) != error_mark_node + && IS_SIGNATURE (TREE_TYPE (vars))) + { + if (vardecl_fn) (*vardecl_fn) (prev, vars); + } + else + prev = vars; + } +} + extern int parse_time, varconst_time; #define TIMEVAR(VAR, BODY) \ @@ -2756,6 +2798,7 @@ finish_file () #endif walk_vtables ((void (*)())0, finish_vtable_vardecl); + walk_sigtables ((void (*)())0, finish_sigtable_vardecl); for (vars = getdecls (); vars; vars = TREE_CHAIN (vars)) { diff --git a/gcc/cp/sig.c b/gcc/cp/sig.c index 4f27b944101..14261684a1a 100644 --- a/gcc/cp/sig.c +++ b/gcc/cp/sig.c @@ -591,6 +591,7 @@ build_signature_table_constructor (sig_ty, rhs) offset = integer_zero_node; pfn = build_unary_op (ADDR_EXPR, rhs_method, 0); TREE_TYPE (pfn) = ptr_type_node; + TREE_ADDRESSABLE (rhs_method) = 1; } tbl_entry = tree_cons (NULL_TREE, code, -- 2.34.1