* dwarf2.c: Formatting.

(add_line_info): Remove outer loop.
This commit is contained in:
Alan Modra
2006-03-06 04:52:03 +00:00
parent d4c32a815a
commit d8d1c398ee
2 changed files with 72 additions and 78 deletions

View File

@ -1,3 +1,8 @@
2006-03-06 Alan Modra <amodra@bigpond.net.au>
* dwarf2.c: Formatting.
(add_line_info): Remove outer loop.
2006-03-05 H.J. Lu <hongjiu.lu@intel.com> 2006-03-05 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra <amodra@bigpond.net.au> Alan Modra <amodra@bigpond.net.au>

View File

@ -1,6 +1,6 @@
/* DWARF 2 support. /* DWARF 2 support.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005 Free Software Foundation, Inc. 2004, 2005, 2006 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com). (gavin@cygnus.com).
@ -813,7 +813,6 @@ add_line_info (struct line_info_table *table,
Note: we may receive duplicate entries from 'decode_line_info'. */ Note: we may receive duplicate entries from 'decode_line_info'. */
while (1)
if (!table->last_line if (!table->last_line
|| new_line_sorts_after (info, table->last_line)) || new_line_sorts_after (info, table->last_line))
{ {
@ -824,31 +823,19 @@ add_line_info (struct line_info_table *table,
/* lcl_head: initialize to head a *possible* sequence at the end. */ /* lcl_head: initialize to head a *possible* sequence at the end. */
if (!table->lcl_head) if (!table->lcl_head)
table->lcl_head = info; table->lcl_head = info;
break;
} }
else if (!table->lcl_head->prev_line else if (!new_line_sorts_after (info, table->lcl_head)
&& !new_line_sorts_after (info, table->lcl_head)) && (!table->lcl_head->prev_line
|| new_line_sorts_after (info, table->lcl_head->prev_line)))
{ {
/* Abnormal but easy: lcl_head is 1) at the *end* of the line /* Abnormal but easy: lcl_head is the head of 'info'. */
list and 2) the head of 'info'. */
info->prev_line = NULL;
table->lcl_head->prev_line = info;
break;
}
else if (table->lcl_head->prev_line
&& !new_line_sorts_after (info, table->lcl_head)
&& new_line_sorts_after (info, table->lcl_head->prev_line))
{
/* Abnormal but easy: lcl_head is 1) in the *middle* of the line
list and 2) the head of 'info'. */
info->prev_line = table->lcl_head->prev_line; info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info; table->lcl_head->prev_line = info;
break;
} }
else else
{ {
/* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid /* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid
heads for 'info'. Reset 'lcl_head' and repeat. */ heads for 'info'. Reset 'lcl_head'. */
struct line_info* li2 = table->last_line; /* always non-NULL */ struct line_info* li2 = table->last_line; /* always non-NULL */
struct line_info* li1 = li2->prev_line; struct line_info* li1 = li2->prev_line;
@ -862,6 +849,8 @@ add_line_info (struct line_info_table *table,
li1 = li1->prev_line; li1 = li1->prev_line;
} }
table->lcl_head = li2; table->lcl_head = li2;
info->prev_line = table->lcl_head->prev_line;
table->lcl_head->prev_line = info;
} }
} }