summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-22 11:33:52 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-22 11:33:52 +0000
commitdff29840073999137197b50c24f82a364d3cdb95 (patch)
tree3b6acf09ef6a5765b5f60b8c1bf03e15f8f64eee /gcc/dwarf2out.c
parent8691d3a1a9fdca1ea55df0fa0ba251de00e3ff7a (diff)
downloadgcc-dff29840073999137197b50c24f82a364d3cdb95.tar.gz
* dwarf2out.c (equate_decl_number_to_die): Add "int" to decls.
(loc_descriptor_from_tree, case CALL_EXPR, case ADDR_EXPR): New. (add_bound_info, default): If can't find a context, make a SAVE_EXPR. (dwarf2out_finish): Check for SAVE_EXPR in node->created_for. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index c0b9958b2c7..18fcfb0db5c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5116,8 +5116,8 @@ equate_decl_number_to_die (decl, decl_die)
tree decl;
dw_die_ref decl_die;
{
- unsigned decl_id = DECL_UID (decl);
- unsigned num_allocated;
+ unsigned int decl_id = DECL_UID (decl);
+ unsigned int num_allocated;
if (decl_id >= decl_die_table_allocated)
{
@@ -7973,6 +7973,24 @@ loc_descriptor_from_tree (loc, addressp)
the names of types. */
return 0;
+ case CALL_EXPR:
+ return 0;
+
+ case ADDR_EXPR:
+ /* We can support this only if we can look through conversions and
+ find an INDIRECT_EXPR. */
+ for (loc = TREE_OPERAND (loc, 0);
+ TREE_CODE (loc) == CONVERT_EXPR || TREE_CODE (loc) == NOP_EXPR
+ || TREE_CODE (loc) == NON_LVALUE_EXPR
+ || TREE_CODE (loc) == VIEW_CONVERT_EXPR
+ || TREE_CODE (loc) == SAVE_EXPR;
+ loc = TREE_OPERAND (loc, 0))
+ ;
+
+ return (TREE_CODE (loc) == INDIRECT_REF
+ ? loc_descriptor_from_tree (TREE_OPERAND (loc, 0), addressp)
+ : 0);
+
case VAR_DECL:
case PARM_DECL:
{
@@ -9077,6 +9095,15 @@ add_bound_info (subrange_die, bound_attr, bound)
else
ctx = lookup_decl_die (current_function_decl);
+ /* If we weren't able to find a context, it's most likely the case
+ that we are processing the return type of the function. So
+ make a SAVE_EXPR to point to it and have the limbo DIE code
+ find the proper die. The save_expr function doesn't always
+ make a SAVE_EXPR, so do it ourselves. */
+ if (ctx == 0)
+ bound = build (SAVE_EXPR, TREE_TYPE (bound), bound,
+ current_function_decl, NULL_TREE);
+
decl_die = new_die (DW_TAG_variable, ctx, bound);
add_AT_flag (decl_die, DW_AT_artificial, 1);
add_type_attribute (decl_die, TREE_TYPE (bound), 1, 0, ctx);
@@ -12013,6 +12040,15 @@ dwarf2out_finish (input_filename)
add_child_die (origin->die_parent, die);
else if (die == comp_unit_die)
;
+ /* If this was an expression for a bound involved in a function
+ return type, it may be a SAVE_EXPR for which we weren't able
+ to find a DIE previously. So try now. */
+ else if (node->created_for
+ && TREE_CODE (node->created_for) == SAVE_EXPR
+ && 0 != (origin = (lookup_decl_die
+ (SAVE_EXPR_CONTEXT
+ (node->created_for)))))
+ add_child_die (origin, die);
else if (node->created_for
&& ((DECL_P (node->created_for)
&& (context = DECL_CONTEXT (node->created_for)))