Commit f93dacbd by Richard Kenner

function.h (no_debugging_symbols): New field.

	* function.h (no_debugging_symbols): New field.
	* integrate.c (save_for_inline): Renamed from save_for_inline_nocopy.
	Initialize no_debugging_symbols.
	(output_inline_function): Save and restore write_symbols and set from
	no_debugging_symbols.
	* toplev.c (rest_of_compilation): Call save_for_inline.
	* tree.h: Update comment.

From-SVN: r36461
parent 5748b2cb
...@@ -444,6 +444,7 @@ struct function ...@@ -444,6 +444,7 @@ struct function
/* For integrate.c. */ /* For integrate.c. */
int inlinable; int inlinable;
int no_debugging_symbols;
/* This is in fact an rtvec. */ /* This is in fact an rtvec. */
void *original_arg_vector; void *original_arg_vector;
tree original_decl_initial; tree original_decl_initial;
......
...@@ -263,7 +263,7 @@ static tree *parmdecl_map; ...@@ -263,7 +263,7 @@ static tree *parmdecl_map;
/* In save_for_inline, nonzero if past the parm-initialization insns. */ /* In save_for_inline, nonzero if past the parm-initialization insns. */
static int in_nonparm_insns; static int in_nonparm_insns;
/* Subroutine for `save_for_inline_nocopy'. Performs initialization /* Subroutine for `save_for_inline'. Performs initialization
needed to save FNDECL's insns and info for future inline expansion. */ needed to save FNDECL's insns and info for future inline expansion. */
static rtvec static rtvec
...@@ -399,7 +399,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn) ...@@ -399,7 +399,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
functions at the end of compilation. */ functions at the end of compilation. */
void void
save_for_inline_nocopy (fndecl) save_for_inline (fndecl)
tree fndecl; tree fndecl;
{ {
rtx insn; rtx insn;
...@@ -454,6 +454,7 @@ save_for_inline_nocopy (fndecl) ...@@ -454,6 +454,7 @@ save_for_inline_nocopy (fndecl)
cfun->inl_last_parm_insn = cfun->x_last_parm_insn; cfun->inl_last_parm_insn = cfun->x_last_parm_insn;
cfun->original_arg_vector = argvec; cfun->original_arg_vector = argvec;
cfun->original_decl_initial = DECL_INITIAL (fndecl); cfun->original_decl_initial = DECL_INITIAL (fndecl);
cfun->no_debugging_symbols = (write_symbols == NO_DEBUG);
DECL_SAVED_INSNS (fndecl) = cfun; DECL_SAVED_INSNS (fndecl) = cfun;
/* Clean up. */ /* Clean up. */
...@@ -1213,8 +1214,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1213,8 +1214,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
computed in expand_inline_function. This function may call itself for computed in expand_inline_function. This function may call itself for
insns containing sequences. insns containing sequences.
Copying is done in two passes, first the insns and then their REG_NOTES, Copying is done in two passes, first the insns and then their REG_NOTES.
just like save_for_inline.
If static_chain_value is non-zero, it represents the context-pointer If static_chain_value is non-zero, it represents the context-pointer
register for the function. */ register for the function. */
...@@ -1234,7 +1234,7 @@ copy_insn_list (insns, map, static_chain_value) ...@@ -1234,7 +1234,7 @@ copy_insn_list (insns, map, static_chain_value)
#endif #endif
/* Copy the insns one by one. Do this in two passes, first the insns and /* Copy the insns one by one. Do this in two passes, first the insns and
then their REG_NOTES, just like save_for_inline. */ then their REG_NOTES. */
/* This loop is very similar to the loop in copy_loop_body in unroll.c. */ /* This loop is very similar to the loop in copy_loop_body in unroll.c. */
...@@ -1503,9 +1503,7 @@ copy_insn_list (insns, map, static_chain_value) ...@@ -1503,9 +1503,7 @@ copy_insn_list (insns, map, static_chain_value)
discarded because it is important to have only one of discarded because it is important to have only one of
each in the current function. each in the current function.
NOTE_INSN_DELETED notes aren't useful (save_for_inline NOTE_INSN_DELETED notes aren't useful.
deleted these in the copy used for continuing compilation,
not the copy used for inlining).
NOTE_INSN_BASIC_BLOCK is discarded because the saved bb NOTE_INSN_BASIC_BLOCK is discarded because the saved bb
pointer (which will soon be dangling) confuses flow's pointer (which will soon be dangling) confuses flow's
...@@ -2767,6 +2765,7 @@ output_inline_function (fndecl) ...@@ -2767,6 +2765,7 @@ output_inline_function (fndecl)
tree fndecl; tree fndecl;
{ {
struct function *old_cfun = cfun; struct function *old_cfun = cfun;
enum debug_info_type old_write_symbols = write_symbols;
struct function *f = DECL_SAVED_INSNS (fndecl); struct function *f = DECL_SAVED_INSNS (fndecl);
cfun = f; cfun = f;
...@@ -2782,6 +2781,10 @@ output_inline_function (fndecl) ...@@ -2782,6 +2781,10 @@ output_inline_function (fndecl)
/* We're not deferring this any longer. */ /* We're not deferring this any longer. */
DECL_DEFER_OUTPUT (fndecl) = 0; DECL_DEFER_OUTPUT (fndecl) = 0;
/* If requested, suppress debugging information. */
if (f->no_debugging_symbols)
write_symbols = NO_DEBUG;
/* Compile this function all the way down to assembly code. */ /* Compile this function all the way down to assembly code. */
rest_of_compilation (fndecl); rest_of_compilation (fndecl);
...@@ -2791,4 +2794,5 @@ output_inline_function (fndecl) ...@@ -2791,4 +2794,5 @@ output_inline_function (fndecl)
cfun = old_cfun; cfun = old_cfun;
current_function_decl = old_cfun ? old_cfun->decl : 0; current_function_decl = old_cfun ? old_cfun->decl : 0;
write_symbols = old_write_symbols;
} }
...@@ -2778,17 +2778,15 @@ rest_of_compilation (decl) ...@@ -2778,17 +2778,15 @@ rest_of_compilation (decl)
if (DECL_DEFER_OUTPUT (decl)) if (DECL_DEFER_OUTPUT (decl))
{ {
/* If -Wreturn-type, we have to do a bit of compilation. /* If -Wreturn-type, we have to do a bit of compilation. We just
However, if we just fall through we will call want to call jump_optimize to figure out whether or not we can
save_for_inline_copying() which results in excessive fall off the end of the function; we do the minimum amount of
memory use. Instead, we just want to call work necessary to make that safe. And, we set optimize to zero
jump_optimize() to figure out whether or not we can fall to keep jump_optimize from working too hard. */
off the end of the function; we do the minimum amount of
work necessary to make that safe. And, we set optimize
to zero to keep jump_optimize from working too hard. */
if (warn_return_type) if (warn_return_type)
{ {
int saved_optimize = optimize; int saved_optimize = optimize;
optimize = 0; optimize = 0;
find_exception_handler_labels (); find_exception_handler_labels ();
jump_optimize (insns, !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES, jump_optimize (insns, !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES,
...@@ -2803,7 +2801,7 @@ rest_of_compilation (decl) ...@@ -2803,7 +2801,7 @@ rest_of_compilation (decl)
TREE_NOTHROW (current_function_decl) = 1; TREE_NOTHROW (current_function_decl) = 1;
timevar_push (TV_INTEGRATION); timevar_push (TV_INTEGRATION);
save_for_inline_nocopy (decl); save_for_inline (decl);
timevar_pop (TV_INTEGRATION); timevar_pop (TV_INTEGRATION);
DECL_SAVED_INSNS (decl)->inlinable = inlinable; DECL_SAVED_INSNS (decl)->inlinable = inlinable;
goto exit_rest_of_compilation; goto exit_rest_of_compilation;
...@@ -2862,7 +2860,6 @@ rest_of_compilation (decl) ...@@ -2862,7 +2860,6 @@ rest_of_compilation (decl)
#endif #endif
/* From now on, allocate rtl in current_obstack, not in saveable_obstack. /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
Note that that may have been done above, in save_for_inline_copying.
The call to resume_temporary_allocation near the end of this function The call to resume_temporary_allocation near the end of this function
goes back to the usual state of affairs. This must be done after goes back to the usual state of affairs. This must be done after
we've built up any unwinders for exception handling, and done we've built up any unwinders for exception handling, and done
......
...@@ -1386,11 +1386,10 @@ struct tree_type ...@@ -1386,11 +1386,10 @@ struct tree_type
#define DECL_ORIGIN(NODE) \ #define DECL_ORIGIN(NODE) \
(DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : NODE) (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : NODE)
/* Nonzero for any sort of ..._DECL node means this decl node represents /* Nonzero for any sort of ..._DECL node means this decl node represents an
an inline instance of some original (abstract) decl from an inline function; inline instance of some original (abstract) decl from an inline function;
suppress any warnings about shadowing some other variable. suppress any warnings about shadowing some other variable. FUNCTION_DECL
FUNCTION_DECL nodes can also have their abstract origin set to themselves nodes can also have their abstract origin set to themselves. */
(see save_for_inline_copying). */
#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0 \ #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0 \
&& DECL_ABSTRACT_ORIGIN (NODE) != (NODE)) && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
...@@ -2789,8 +2788,7 @@ extern int global_bindings_p PARAMS ((void)); ...@@ -2789,8 +2788,7 @@ extern int global_bindings_p PARAMS ((void));
extern void insert_block PARAMS ((tree)); extern void insert_block PARAMS ((tree));
/* In integrate.c */ /* In integrate.c */
extern void save_for_inline_nocopy PARAMS ((tree)); extern void save_for_inline PARAMS ((tree));
extern void save_for_inline_copying PARAMS ((tree));
extern void set_decl_abstract_flags PARAMS ((tree, int)); extern void set_decl_abstract_flags PARAMS ((tree, int));
extern void output_inline_function PARAMS ((tree)); extern void output_inline_function PARAMS ((tree));
extern void set_decl_origin_self PARAMS ((tree)); extern void set_decl_origin_self PARAMS ((tree));
......
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