diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1996-05-02 16:31:04 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-05-02 16:31:04 +0000 |
commit | 809c8c30be2829c4a7d60ec52c34274804a80aad (patch) | |
tree | 72594d744b0932519be2df3c1b2f5e24c0936936 /gcc/cp | |
parent | 1df8f58fafb0cc8221a9828239fde24dcb9e9cc1 (diff) | |
download | gcc-809c8c30be2829c4a7d60ec52c34274804a80aad.tar.gz |
86th Cygnus<->FSF quick merge
From-SVN: r11914
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 20 | ||||
-rw-r--r-- | gcc/cp/lex.c | 10 | ||||
-rw-r--r-- | gcc/cp/method.c | 26 |
4 files changed, 64 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9d9a755a9a2..4c00b1e87b9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,20 @@ +Wed May 1 11:26:52 1996 Jason Merrill <jason@yorick.cygnus.com> + + * decl2.c (finish_file): Also use sentries for vars with + DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be + created). + + * lex.c (handle_cp_pragma): Disable #pragma + interface/implementation if SUPPORTS_ONE_ONLY > 1. + +Tue Apr 30 11:25:46 1996 Jason Merrill <jason@yorick.cygnus.com> + + * method.c (emit_thunk): Wrap default case in + temporary/permanent_allocation. + + * method.c (make_thunk): Use DECL_ONE_ONLY. + (emit_thunk): Call assemble_end_function. + Mon Apr 29 15:38:29 1996 Jason Merrill <jason@yorick.cygnus.com> * decl2.c (import_export_vtable): Use DECL_ONE_ONLY. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index cdfcfa084d2..49011d67b77 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3008,9 +3008,15 @@ finish_file () if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars) && ! DECL_EXTERNAL (decl)) { + int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl) +#ifdef DECL_ONE_ONLY + || DECL_ONE_ONLY (decl) +#endif + || DECL_WEAK (decl))); + temp = build_cleanup (decl); - if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) + if (protect) { tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl)); sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0); @@ -3020,7 +3026,7 @@ finish_file () expand_expr_stmt (temp); - if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) + if (protect) expand_end_cond (); } } @@ -3083,6 +3089,12 @@ finish_file () if (TREE_CODE (decl) == VAR_DECL) { + int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl) +#ifdef DECL_ONE_ONLY + || DECL_ONE_ONLY (decl) +#endif + || DECL_WEAK (decl))); + /* Set these global variables so that GDB at least puts us near the declaration which required the initialization. */ input_filename = DECL_SOURCE_FILE (decl); @@ -3094,7 +3106,7 @@ finish_file () DECL_CLASS_CONTEXT (current_function_decl) = DECL_CONTEXT (decl); DECL_STATIC_FUNCTION_P (current_function_decl) = 1; - if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) + if (protect) { tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl)); sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0); @@ -3116,7 +3128,7 @@ finish_file () else expand_assignment (decl, init, 0, 0); - if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) + if (protect) expand_end_cond (); DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index fb0ebbc7279..0b46990f60d 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -4449,6 +4449,11 @@ handle_cp_pragma (pname) } main_filename = TREE_STRING_POINTER (yylval.ttype); } + +#ifdef SUPPORTS_ONE_ONLY + if (SUPPORTS_ONE_ONLY > 1) + return 1; +#endif while (token != END_OF_LINE) { @@ -4518,6 +4523,11 @@ handle_cp_pragma (pname) token = real_yylex (); } +#ifdef SUPPORTS_ONE_ONLY + if (SUPPORTS_ONE_ONLY > 1) + return 1; +#endif + if (write_virtuals == 3) { struct impl_files *ifiles = impl_file_chain; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index d31ea15479b..5e1793bcc05 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -39,6 +39,10 @@ Boston, MA 02111-1307, USA. */ #include "hard-reg-set.h" #include "flags.h" +#ifndef SUPPORTS_ONE_ONLY +#define SUPPORTS_ONE_ONLY 0 +#endif + /* TREE_LIST of the current inline functions that need to be processed. */ struct pending_inline *pending_inlines; @@ -1831,7 +1835,15 @@ make_thunk (function, delta) DECL_INITIAL (thunk) = function; THUNK_DELTA (thunk) = delta; DECL_EXTERNAL (thunk) = 1; - TREE_PUBLIC (thunk) = 0; +#ifdef DECL_ONE_ONLY + if (SUPPORTS_ONE_ONLY) + { + DECL_ONE_ONLY (thunk) = 1; + TREE_PUBLIC (thunk) = 1; + } + else +#endif + TREE_PUBLIC (thunk) = 0; /* So that finish_file can write out any thunks that need to be: */ pushdecl_top_level (thunk); } @@ -1868,20 +1880,24 @@ emit_thunk (thunk_fndecl) TREE_ASM_WRITTEN (thunk_fndecl) = 1; + TREE_ADDRESSABLE (function) = 1; + mark_used (function); + decl_printable_name = thunk_printable_name; if (current_function_decl) abort (); current_function_decl = thunk_fndecl; - TREE_ADDRESSABLE (function) = 1; - mark_used (function); #ifdef ASM_OUTPUT_MI_THUNK assemble_start_function (thunk_fndecl, fnname); ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function); + assemble_end_function (thunk_fndecl, fnname); #else init_function_start (thunk_fndecl, input_filename, lineno); pushlevel (0); expand_start_bindings (1); + temporary_allocation (); + /* Start updating where the next arg would go. */ INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (function), NULL_RTX, 0); stack_args_size.constant = 0; @@ -2053,10 +2069,10 @@ emit_thunk (thunk_fndecl) /* Cancel the effect of rtl_in_current_obstack. */ - resume_temporary_allocation (); + permanent_allocation (1); +#endif /* ASM_OUTPUT_MI_THUNK */ decl_printable_name = save_decl_printable_name; -#endif /* ASM_OUTPUT_MI_THUNK */ current_function_decl = 0; } |