Commit 809c8c30 by Jason Merrill Committed by Mike Stump

86th Cygnus<->FSF quick merge

From-SVN: r11914
parent 1df8f58f
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> Mon Apr 29 15:38:29 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_vtable): Use DECL_ONE_ONLY. * decl2.c (import_export_vtable): Use DECL_ONE_ONLY.
......
...@@ -3008,9 +3008,15 @@ finish_file () ...@@ -3008,9 +3008,15 @@ finish_file ()
if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars) if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars)
&& ! DECL_EXTERNAL (decl)) && ! 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); temp = build_cleanup (decl);
if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) if (protect)
{ {
tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl)); tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0); sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0);
...@@ -3020,7 +3026,7 @@ finish_file () ...@@ -3020,7 +3026,7 @@ finish_file ()
expand_expr_stmt (temp); expand_expr_stmt (temp);
if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) if (protect)
expand_end_cond (); expand_end_cond ();
} }
} }
...@@ -3083,6 +3089,12 @@ finish_file () ...@@ -3083,6 +3089,12 @@ finish_file ()
if (TREE_CODE (decl) == VAR_DECL) 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 /* Set these global variables so that GDB at least puts
us near the declaration which required the initialization. */ us near the declaration which required the initialization. */
input_filename = DECL_SOURCE_FILE (decl); input_filename = DECL_SOURCE_FILE (decl);
...@@ -3094,7 +3106,7 @@ finish_file () ...@@ -3094,7 +3106,7 @@ finish_file ()
DECL_CLASS_CONTEXT (current_function_decl) = DECL_CONTEXT (decl); DECL_CLASS_CONTEXT (current_function_decl) = DECL_CONTEXT (decl);
DECL_STATIC_FUNCTION_P (current_function_decl) = 1; 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)); tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0); sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0);
...@@ -3116,7 +3128,7 @@ finish_file () ...@@ -3116,7 +3128,7 @@ finish_file ()
else else
expand_assignment (decl, init, 0, 0); expand_assignment (decl, init, 0, 0);
if (DECL_COMMON (decl) && TREE_PUBLIC (decl)) if (protect)
expand_end_cond (); expand_end_cond ();
DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE; DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE;
......
...@@ -4449,6 +4449,11 @@ handle_cp_pragma (pname) ...@@ -4449,6 +4449,11 @@ handle_cp_pragma (pname)
} }
main_filename = TREE_STRING_POINTER (yylval.ttype); main_filename = TREE_STRING_POINTER (yylval.ttype);
} }
#ifdef SUPPORTS_ONE_ONLY
if (SUPPORTS_ONE_ONLY > 1)
return 1;
#endif
while (token != END_OF_LINE) while (token != END_OF_LINE)
{ {
...@@ -4518,6 +4523,11 @@ handle_cp_pragma (pname) ...@@ -4518,6 +4523,11 @@ handle_cp_pragma (pname)
token = real_yylex (); token = real_yylex ();
} }
#ifdef SUPPORTS_ONE_ONLY
if (SUPPORTS_ONE_ONLY > 1)
return 1;
#endif
if (write_virtuals == 3) if (write_virtuals == 3)
{ {
struct impl_files *ifiles = impl_file_chain; struct impl_files *ifiles = impl_file_chain;
......
...@@ -39,6 +39,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -39,6 +39,10 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h" #include "hard-reg-set.h"
#include "flags.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 /* TREE_LIST of the current inline functions that need to be
processed. */ processed. */
struct pending_inline *pending_inlines; struct pending_inline *pending_inlines;
...@@ -1831,7 +1835,15 @@ make_thunk (function, delta) ...@@ -1831,7 +1835,15 @@ make_thunk (function, delta)
DECL_INITIAL (thunk) = function; DECL_INITIAL (thunk) = function;
THUNK_DELTA (thunk) = delta; THUNK_DELTA (thunk) = delta;
DECL_EXTERNAL (thunk) = 1; 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: */ /* So that finish_file can write out any thunks that need to be: */
pushdecl_top_level (thunk); pushdecl_top_level (thunk);
} }
...@@ -1868,20 +1880,24 @@ emit_thunk (thunk_fndecl) ...@@ -1868,20 +1880,24 @@ emit_thunk (thunk_fndecl)
TREE_ASM_WRITTEN (thunk_fndecl) = 1; TREE_ASM_WRITTEN (thunk_fndecl) = 1;
TREE_ADDRESSABLE (function) = 1;
mark_used (function);
decl_printable_name = thunk_printable_name; decl_printable_name = thunk_printable_name;
if (current_function_decl) if (current_function_decl)
abort (); abort ();
current_function_decl = thunk_fndecl; current_function_decl = thunk_fndecl;
TREE_ADDRESSABLE (function) = 1;
mark_used (function);
#ifdef ASM_OUTPUT_MI_THUNK #ifdef ASM_OUTPUT_MI_THUNK
assemble_start_function (thunk_fndecl, fnname); assemble_start_function (thunk_fndecl, fnname);
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function); ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
#else #else
init_function_start (thunk_fndecl, input_filename, lineno); init_function_start (thunk_fndecl, input_filename, lineno);
pushlevel (0); pushlevel (0);
expand_start_bindings (1); expand_start_bindings (1);
temporary_allocation ();
/* Start updating where the next arg would go. */ /* Start updating where the next arg would go. */
INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (function), NULL_RTX, 0); INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (function), NULL_RTX, 0);
stack_args_size.constant = 0; stack_args_size.constant = 0;
...@@ -2053,10 +2069,10 @@ emit_thunk (thunk_fndecl) ...@@ -2053,10 +2069,10 @@ emit_thunk (thunk_fndecl)
/* Cancel the effect of rtl_in_current_obstack. */ /* 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; decl_printable_name = save_decl_printable_name;
#endif /* ASM_OUTPUT_MI_THUNK */
current_function_decl = 0; current_function_decl = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment