Commit 2731cf24 by Frank Ch. Eigler Committed by Frank Ch. Eigler

profile.c (branch_prob): Restore support for USE_MAPPED_LOCATION.

2004-09-16  Frank Ch. Eigler  <fche@redhat.com>

	* profile.c (branch_prob): Restore support for USE_MAPPED_LOCATION.

From-SVN: r87613
parent 8304ad70
2004-09-16 Frank Ch. Eigler <fche@redhat.com>
* profile.c (branch_prob): Restore support for USE_MAPPED_LOCATION.
2004-09-16 Jeff Law <law@redhat.com> 2004-09-16 Jeff Law <law@redhat.com>
* tree-into-ssa.c (block_defs_stack): New toplevel varray. * tree-into-ssa.c (block_defs_stack): New toplevel varray.
......
...@@ -1001,7 +1001,6 @@ branch_prob (void) ...@@ -1001,7 +1001,6 @@ branch_prob (void)
else else
{ {
gcov_position_t offset; gcov_position_t offset;
location_t *curr_location = NULL;
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
...@@ -1011,21 +1010,19 @@ branch_prob (void) ...@@ -1011,21 +1010,19 @@ branch_prob (void)
if (bb == ENTRY_BLOCK_PTR->next_bb) if (bb == ENTRY_BLOCK_PTR->next_bb)
{ {
curr_location = &DECL_SOURCE_LOCATION (current_function_decl); expanded_location curr_location =
output_location (curr_location->file, curr_location->line, expand_location (DECL_SOURCE_LOCATION
(current_function_decl));
output_location (curr_location.file, curr_location.line,
&offset, bb); &offset, bb);
} }
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{ {
tree stmt = bsi_stmt (bsi); tree stmt = bsi_stmt (bsi);
#ifdef USE_MAPPED_LOCATION if (EXPR_HAS_LOCATION (stmt))
curr_location = EXPR_LOCATION (stmt); output_location (EXPR_FILENAME (stmt),
#else EXPR_LINENO (stmt),
curr_location = EXPR_LOCUS (stmt);
#endif
if (curr_location)
output_location (curr_location->file, curr_location->line,
&offset, bb); &offset, bb);
} }
...@@ -1033,8 +1030,17 @@ branch_prob (void) ...@@ -1033,8 +1030,17 @@ branch_prob (void)
CFG. */ CFG. */
if (bb->succ && !bb->succ->succ_next && bb->succ->goto_locus) if (bb->succ && !bb->succ->succ_next && bb->succ->goto_locus)
{ {
curr_location = bb->succ->goto_locus; /* ??? source_locus type is marked deprecated in input.h. */
output_location (curr_location->file, curr_location->line, &offset, bb); source_locus curr_location = bb->succ->goto_locus;
/* ??? The FILE/LINE API is inconsistent for these cases. */
#ifdef USE_MAPPED_LOCATION
output_location (LOCATION_FILE (curr_location),
LOCATION_LINE (curr_location),
&offset, bb);
#else
output_location (curr_location->file, curr_location->line,
&offset, bb);
#endif
} }
if (offset) if (offset)
......
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