[rtlopt] dwarf2out.c: fix coding style in new code
Josef Zlomek
zlomj9am@artax.karlin.mff.cuni.cz
Wed Feb 19 18:21:00 GMT 2003
Hi,
this patch fixes coding style on some places.
Compiled x86-64.
Josef
2003-02-19 Josef Zlomek <zlomekj@suse.cz>
* dwarf2out.c: Fix coding style on some places.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.382.2.8
diff -c -3 -p -r1.382.2.8 dwarf2out.c
*** dwarf2out.c 8 Feb 2003 19:43:32 -0000 1.382.2.8
--- dwarf2out.c 19 Feb 2003 18:18:45 -0000
*************** struct var_loc_node GTY ((chain_next ("%
*** 3485,3500 ****
rtx GTY (()) var_loc_note;
const char * GTY (()) label;
struct var_loc_node * GTY (()) next;
- /* struct var_loc_node *last;*/
};
/* Unique label counter. */
static unsigned int loclabel_num = 0;
/* Table of decl location linked lists. */
static GTY ((length ("decl_loc_table_allocated"))) struct var_loc_node **decl_loc_table;
/* Number of elements in the decl_loc_table that are allocated. */
static unsigned decl_loc_table_allocated;
/* Number of elements in the decl_loc_table that are in use. */
static unsigned decl_loc_table_in_use;
#define DECL_LOC_TABLE_INCREMENT 256
/* A pointer to the base of a list of references to DIE's that
--- 3485,3506 ----
rtx GTY (()) var_loc_note;
const char * GTY (()) label;
struct var_loc_node * GTY (()) next;
};
+
/* Unique label counter. */
static unsigned int loclabel_num = 0;
+
/* Table of decl location linked lists. */
static GTY ((length ("decl_loc_table_allocated"))) struct var_loc_node **decl_loc_table;
+
/* Number of elements in the decl_loc_table that are allocated. */
static unsigned decl_loc_table_allocated;
+
/* Number of elements in the decl_loc_table that are in use. */
static unsigned decl_loc_table_in_use;
+
+ /* Size (in elements) of increments by which we may expand the
+ decl_die_table. */
#define DECL_LOC_TABLE_INCREMENT 256
/* A pointer to the base of a list of references to DIE's that
*************** static struct var_loc_node * lookup_decl
*** 5303,5308 ****
--- 5309,5315 ----
static void add_var_loc_to_decl PARAMS ((tree, struct var_loc_node *));
/* Return the var_loc list associated with a given declaration. */
+
static inline struct var_loc_node *
lookup_decl_loc (decl)
tree decl;
*************** equate_decl_number_to_die (decl, decl_di
*** 5344,5349 ****
--- 5351,5357 ----
}
/* Add a variable location node to the linked list for DECL. */
+
static void
add_var_loc_to_decl (decl, loc)
tree decl;
*************** add_var_loc_to_decl (decl, loc)
*** 5352,5357 ****
--- 5360,5366 ----
unsigned int decl_id = DECL_UID (decl);
unsigned int num_allocated;
struct var_loc_node *temp;
+
if (decl_id >= decl_loc_table_allocated)
{
num_allocated
*************** add_var_loc_to_decl (decl, loc)
*** 5382,5387 ****
--- 5391,5397 ----
/* Get to the end of the list */
while (temp->next != NULL)
temp = temp->next;
+
/* If the current location is the same as the end of the list,
just extend the range of the location at the end of the
list. */
*************** loc_descriptor (rtl)
*** 8597,8602 ****
--- 8607,8613 ----
case CONCAT:
loc_result = concat_loc_descriptor (XEXP (rtl, 0), XEXP (rtl, 1));
break;
+
case VAR_LOCATION:
/* Single part */
if (GET_CODE (XEXP (rtl, 1)) != PARALLEL)
*************** loc_descriptor (rtl)
*** 8624,8629 ****
--- 8635,8641 ----
}
}
break;
+
default:
return 0;
}
*************** init_file_table ()
*** 12584,12592 ****
--- 12596,12606 ----
VARRAY_PUSH_CHAR_PTR (file_table, NULL);
file_table_last_lookup_index = 0;
}
+
/* Called by the final INSN scan whenever we see a var location. We
use it to drop labels in the right places, and throw the location in
our lookup table. */
+
static void
dwarf2out_var_location (loc_note)
rtx loc_note;
*************** dwarf2out_var_location (loc_note)
*** 12596,12601 ****
--- 12610,12616 ----
if (!DECL_P (NOTE_VAR_LOCATION_DECL (loc_note)))
return;
+
newloc = ggc_alloc_cleared (sizeof (struct var_loc_node));
ASM_GENERATE_INTERNAL_LABEL (loclabel, "LVL", loclabel_num++);
ASM_OUTPUT_LABEL (asm_out_file, loclabel);
*************** dwarf2out_var_location (loc_note)
*** 12604,12609 ****
--- 12619,12625 ----
add_var_loc_to_decl (NOTE_VAR_LOCATION_DECL (loc_note), newloc);
}
+
/* We need to reset the locations at the beginning of each
function. We can't do this in the end_function hook, because the
declarations that use the locations won't have been outputted when
*************** dwarf2out_begin_function (unused)
*** 12614,12621 ****
tree unused ATTRIBUTE_UNUSED;
{
decl_loc_table_in_use = 0;
! memset (decl_loc_table, 0, sizeof (struct var_loc_node *)
! * decl_loc_table_allocated);
}
/* Output a label to mark the beginning of a source code line entry
and record information relating to this source line, in
--- 12630,12637 ----
tree unused ATTRIBUTE_UNUSED;
{
decl_loc_table_in_use = 0;
! memset (decl_loc_table, 0,
! sizeof (struct var_loc_node *) * decl_loc_table_allocated);
}
/* Output a label to mark the beginning of a source code line entry
and record information relating to this source line, in
More information about the Gcc-patches
mailing list