Commit deb5e280 by Jason Merrill Committed by Jason Merrill

stmt.c (is_body_block): Move...

        * stmt.c (is_body_block): Move...
        * dwarfout.c, dwarf2out.c: ...from here.
        * tree.h: Declare it.
        * emit-rtl.c (remove_unncessary_notes): Don't remove the body block.
        * final.c (final_start_function): Do call remove_unnecessary_notes
        when scheduling.

From-SVN: r32324
parent e8965a18
2000-03-04 Jason Merrill <jason@casey.cygnus.com>
* stmt.c (is_body_block): Move...
* dwarfout.c, dwarf2out.c: ...from here.
* tree.h: Declare it.
* emit-rtl.c (remove_unncessary_notes): Don't remove the body block.
* final.c (final_start_function): Do call remove_unnecessary_notes
when scheduling.
2000-03-03 Zack Weinberg <zack@wolery.cumb.org> 2000-03-03 Zack Weinberg <zack@wolery.cumb.org>
* config/vax/xm-vms.h: Define OBJECT_SUFFIX and EXECUTABLE_SUFFIX. * config/vax/xm-vms.h: Define OBJECT_SUFFIX and EXECUTABLE_SUFFIX.
......
...@@ -2436,7 +2436,6 @@ static void output_pubnames PARAMS ((void)); ...@@ -2436,7 +2436,6 @@ static void output_pubnames PARAMS ((void));
static void add_arange PARAMS ((tree, dw_die_ref)); static void add_arange PARAMS ((tree, dw_die_ref));
static void output_aranges PARAMS ((void)); static void output_aranges PARAMS ((void));
static void output_line_info PARAMS ((void)); static void output_line_info PARAMS ((void));
static int is_body_block PARAMS ((tree));
static dw_die_ref base_type_die PARAMS ((tree)); static dw_die_ref base_type_die PARAMS ((tree));
static tree root_type PARAMS ((tree)); static tree root_type PARAMS ((tree));
static int is_base_type PARAMS ((tree)); static int is_base_type PARAMS ((tree));
...@@ -5924,36 +5923,6 @@ output_line_info () ...@@ -5924,36 +5923,6 @@ output_line_info ()
ASM_OUTPUT_LABEL (asm_out_file, ".LTEND"); ASM_OUTPUT_LABEL (asm_out_file, ".LTEND");
} }
/* Given a pointer to a BLOCK node return non-zero if (and only if) the node
in question represents the outermost pair of curly braces (i.e. the "body
block") of a function or method.
For any BLOCK node representing a "body block" of a function or method, the
BLOCK_SUPERCONTEXT of the node will point to another BLOCK node which
represents the outermost (function) scope for the function or method (i.e.
the one which includes the formal parameters). The BLOCK_SUPERCONTEXT of
*that* node in turn will point to the relevant FUNCTION_DECL node. */
static inline int
is_body_block (stmt)
register tree stmt;
{
if (TREE_CODE (stmt) == BLOCK)
{
register tree parent = BLOCK_SUPERCONTEXT (stmt);
if (TREE_CODE (parent) == BLOCK)
{
register tree grandparent = BLOCK_SUPERCONTEXT (parent);
if (TREE_CODE (grandparent) == FUNCTION_DECL)
return 1;
}
}
return 0;
}
/* Given a pointer to a tree node for some base type, return a pointer to /* Given a pointer to a tree node for some base type, return a pointer to
a DIE that describes the given type. a DIE that describes the given type.
......
...@@ -318,7 +318,6 @@ static tree decl_class_context PARAMS ((tree)); ...@@ -318,7 +318,6 @@ static tree decl_class_context PARAMS ((tree));
static void output_unsigned_leb128 PARAMS ((unsigned long)); static void output_unsigned_leb128 PARAMS ((unsigned long));
static void output_signed_leb128 PARAMS ((long)); static void output_signed_leb128 PARAMS ((long));
#endif #endif
static inline int is_body_block PARAMS ((tree));
static int fundamental_type_code PARAMS ((tree)); static int fundamental_type_code PARAMS ((tree));
static tree root_type_1 PARAMS ((tree, int)); static tree root_type_1 PARAMS ((tree, int));
static tree root_type PARAMS ((tree)); static tree root_type PARAMS ((tree));
...@@ -1282,37 +1281,6 @@ output_signed_leb128 (value) ...@@ -1282,37 +1281,6 @@ output_signed_leb128 (value)
/**************** utility functions for attribute functions ******************/ /**************** utility functions for attribute functions ******************/
/* Given a pointer to a BLOCK node return non-zero if (and only if) the
node in question represents the outermost pair of curly braces (i.e.
the "body block") of a function or method.
For any BLOCK node representing a "body block" of a function or method,
the BLOCK_SUPERCONTEXT of the node will point to another BLOCK node
which represents the outermost (function) scope for the function or
method (i.e. the one which includes the formal parameters). The
BLOCK_SUPERCONTEXT of *that* node in turn will point to the relevant
FUNCTION_DECL node.
*/
static inline int
is_body_block (stmt)
register tree stmt;
{
if (TREE_CODE (stmt) == BLOCK)
{
register tree parent = BLOCK_SUPERCONTEXT (stmt);
if (TREE_CODE (parent) == BLOCK)
{
register tree grandparent = BLOCK_SUPERCONTEXT (parent);
if (TREE_CODE (grandparent) == FUNCTION_DECL)
return 1;
}
}
return 0;
}
/* Given a pointer to a tree node for some type, return a Dwarf fundamental /* Given a pointer to a tree node for some type, return a Dwarf fundamental
type code for the given type. type code for the given type.
......
...@@ -2711,10 +2711,16 @@ remove_unncessary_notes () ...@@ -2711,10 +2711,16 @@ remove_unncessary_notes ()
if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn)) if (NOTE_BLOCK (prev) != NOTE_BLOCK (insn))
abort (); abort ();
debug_ignore_block (NOTE_BLOCK (insn)); /* Never delete the BLOCK for the outermost scope
of the function; we can refer to names from
remove_insn (prev); that scope even if the block notes are messed up. */
remove_insn (insn); if (! is_body_block (NOTE_BLOCK (insn)))
{
debug_ignore_block (NOTE_BLOCK (insn));
remove_insn (prev);
remove_insn (insn);
}
break; break;
} }
else if (NOTE_LINE_NUMBER (prev) == NOTE_INSN_BLOCK_END) else if (NOTE_LINE_NUMBER (prev) == NOTE_INSN_BLOCK_END)
......
...@@ -1644,10 +1644,7 @@ final_start_function (first, file, optimize) ...@@ -1644,10 +1644,7 @@ final_start_function (first, file, optimize)
if (write_symbols) if (write_symbols)
{ {
number_blocks (current_function_decl); number_blocks (current_function_decl);
/* Scheduling packs block notes together at the top of a basic block, remove_unncessary_notes ();
so we can't learn anything from them. */
if (! flag_schedule_insns && ! flag_schedule_insns_after_reload)
remove_unncessary_notes ();
/* We never actually put out begin/end notes for the top-level /* We never actually put out begin/end notes for the top-level
block in the function. But, conceptually, that block is block in the function. But, conceptually, that block is
always needed. */ always needed. */
......
...@@ -3310,6 +3310,36 @@ expand_end_target_temps () ...@@ -3310,6 +3310,36 @@ expand_end_target_temps ()
pop_temp_slots (); pop_temp_slots ();
} }
/* Given a pointer to a BLOCK node return non-zero if (and only if) the node
in question represents the outermost pair of curly braces (i.e. the "body
block") of a function or method.
For any BLOCK node representing a "body block" of a function or method, the
BLOCK_SUPERCONTEXT of the node will point to another BLOCK node which
represents the outermost (function) scope for the function or method (i.e.
the one which includes the formal parameters). The BLOCK_SUPERCONTEXT of
*that* node in turn will point to the relevant FUNCTION_DECL node. */
int
is_body_block (stmt)
register tree stmt;
{
if (TREE_CODE (stmt) == BLOCK)
{
tree parent = BLOCK_SUPERCONTEXT (stmt);
if (parent && TREE_CODE (parent) == BLOCK)
{
tree grandparent = BLOCK_SUPERCONTEXT (parent);
if (grandparent && TREE_CODE (grandparent) == FUNCTION_DECL)
return 1;
}
}
return 0;
}
/* Mark top block of block_stack as an implicit binding for an /* Mark top block of block_stack as an implicit binding for an
exception region. This is used to prevent infinite recursion when exception region. This is used to prevent infinite recursion when
ending a binding with expand_end_bindings. It is only ever called ending a binding with expand_end_bindings. It is only ever called
......
...@@ -2178,6 +2178,8 @@ extern void expand_end_bindings PARAMS ((tree, int, int)); ...@@ -2178,6 +2178,8 @@ extern void expand_end_bindings PARAMS ((tree, int, int));
extern void warn_about_unused_variables PARAMS ((tree)); extern void warn_about_unused_variables PARAMS ((tree));
extern void start_cleanup_deferral PARAMS ((void)); extern void start_cleanup_deferral PARAMS ((void));
extern void end_cleanup_deferral PARAMS ((void)); extern void end_cleanup_deferral PARAMS ((void));
extern int is_body_block PARAMS ((tree));
extern void mark_block_as_eh_region PARAMS ((void)); extern void mark_block_as_eh_region PARAMS ((void));
extern void mark_block_as_not_eh_region PARAMS ((void)); extern void mark_block_as_not_eh_region PARAMS ((void));
extern int is_eh_region PARAMS ((void)); extern int is_eh_region PARAMS ((void));
......
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