Commit 98c0cbd3 by Jakub Jelinek Committed by Jakub Jelinek

dwarf2out.c (fortran_common): Update comment.

	* dwarf2out.c (fortran_common): Update comment.
	(gen_variable_die): Swap com_die and var_die variables in Fortran
	COMMON block handling code.

From-SVN: r139783
parent de870512
2008-08-29 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (fortran_common): Update comment.
(gen_variable_die): Swap com_die and var_die variables in Fortran
COMMON block handling code.
* dwarf2out.c (descr_info_loc): Handle VAR_DECL.
* dwarf2out.c (gen_const_die): New function.
......
......@@ -11556,8 +11556,8 @@ secname_for_decl (const_tree decl)
return secname;
}
/* Check whether decl is a Fortran COMMON symbol. If not, NULL_RTX is returned.
If so, the rtx for the SYMBOL_REF for the COMMON block is returned, and the
/* Check whether decl is a Fortran COMMON symbol. If not, NULL_TREE is
returned. If so, the decl for the COMMON block is returned, and the
value is the offset into the common block for the symbol. */
static tree
......@@ -13780,10 +13780,10 @@ gen_variable_die (tree decl, dw_die_ref context_die)
dw_die_ref com_die;
dw_loc_descr_ref loc;
com_die = lookup_decl_die (decl);
if (com_die)
var_die = lookup_decl_die (decl);
if (var_die)
{
if (get_AT (com_die, DW_AT_location) == NULL)
if (get_AT (var_die, DW_AT_location) == NULL)
{
loc = loc_descriptor_from_tree (com_decl);
if (loc)
......@@ -13791,54 +13791,54 @@ gen_variable_die (tree decl, dw_die_ref context_die)
if (off)
add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst,
off, 0));
add_AT_loc (com_die, DW_AT_location, loc);
remove_AT (com_die, DW_AT_declaration);
add_AT_loc (var_die, DW_AT_location, loc);
remove_AT (var_die, DW_AT_declaration);
}
}
return;
}
field = TREE_OPERAND (DECL_VALUE_EXPR (decl), 0);
var_die = lookup_decl_die (com_decl);
com_die = lookup_decl_die (com_decl);
loc = loc_descriptor_from_tree (com_decl);
if (var_die == NULL)
if (com_die == NULL)
{
const char *cnam
= IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (com_decl));
var_die = new_die (DW_TAG_common_block, context_die, decl);
add_name_and_src_coords_attributes (var_die, com_decl);
com_die = new_die (DW_TAG_common_block, context_die, decl);
add_name_and_src_coords_attributes (com_die, com_decl);
if (loc)
{
add_AT_loc (var_die, DW_AT_location, loc);
add_AT_loc (com_die, DW_AT_location, loc);
/* Avoid sharing the same loc descriptor between
DW_TAG_common_block and DW_TAG_variable. */
loc = loc_descriptor_from_tree (com_decl);
}
else if (DECL_EXTERNAL (decl))
add_AT_flag (var_die, DW_AT_declaration, 1);
add_pubname_string (cnam, var_die); /* ??? needed? */
equate_decl_number_to_die (com_decl, var_die);
add_AT_flag (com_die, DW_AT_declaration, 1);
add_pubname_string (cnam, com_die); /* ??? needed? */
equate_decl_number_to_die (com_decl, com_die);
}
else if (get_AT (var_die, DW_AT_location) == NULL && loc)
else if (get_AT (com_die, DW_AT_location) == NULL && loc)
{
add_AT_loc (var_die, DW_AT_location, loc);
add_AT_loc (com_die, DW_AT_location, loc);
loc = loc_descriptor_from_tree (com_decl);
remove_AT (var_die, DW_AT_declaration);
remove_AT (com_die, DW_AT_declaration);
}
com_die = new_die (DW_TAG_variable, var_die, decl);
add_name_and_src_coords_attributes (com_die, decl);
add_type_attribute (com_die, TREE_TYPE (decl), TREE_READONLY (decl),
var_die = new_die (DW_TAG_variable, com_die, decl);
add_name_and_src_coords_attributes (var_die, decl);
add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl),
TREE_THIS_VOLATILE (decl), context_die);
add_AT_flag (com_die, DW_AT_external, 1);
add_AT_flag (var_die, DW_AT_external, 1);
if (loc)
{
if (off)
add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst, off, 0));
add_AT_loc (com_die, DW_AT_location, loc);
add_AT_loc (var_die, DW_AT_location, loc);
}
else if (DECL_EXTERNAL (decl))
add_AT_flag (com_die, DW_AT_declaration, 1);
equate_decl_number_to_die (decl, com_die);
add_AT_flag (var_die, DW_AT_declaration, 1);
equate_decl_number_to_die (decl, var_die);
return;
}
......
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