static dw_loc_descr_ref new_loc_descr (enum dwarf_location_atom,
unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT);
static void add_loc_descr (dw_loc_descr_ref *, dw_loc_descr_ref);
-static void add_loc_descr_op_piece (dw_loc_descr_ref *, int);
static unsigned long size_of_loc_descr (dw_loc_descr_ref);
static unsigned long size_of_locs (dw_loc_descr_ref);
static void output_loc_operands (dw_loc_descr_ref);
return descr;
}
-
/* Add a location description term to a location description expression. */
static inline void
*d = descr;
}
-
-/* Optionally add a DW_OP_piece term to a location description expression.
- DW_OP_piece is only added if the location description expression already
- doesn't end with DW_OP_piece. */
-
-static void
-add_loc_descr_op_piece (dw_loc_descr_ref *list_head, int size)
-{
- dw_loc_descr_ref loc;
-
- if (*list_head != NULL)
- {
- /* Find the end of the chain. */
- for (loc = *list_head; loc->dw_loc_next != NULL; loc = loc->dw_loc_next)
- ;
-
- if (loc->dw_loc_opc != DW_OP_piece)
- loc->dw_loc_next = new_loc_descr (DW_OP_piece, size, 0);
- }
-}
-
/* Return the size of a location descriptor. */
static unsigned long
static dw_die_ref modified_type_die (tree, int, int, dw_die_ref);
static int type_is_enum (tree);
static unsigned int dbx_reg_number (rtx);
+static void add_loc_descr_op_piece (dw_loc_descr_ref *, int);
static dw_loc_descr_ref reg_loc_descriptor (rtx);
static dw_loc_descr_ref one_reg_loc_descriptor (unsigned int);
static dw_loc_descr_ref multiple_reg_loc_descriptor (rtx, rtx);
return DBX_REGISTER_NUMBER (regno);
}
+/* Optionally add a DW_OP_piece term to a location description expression.
+ DW_OP_piece is only added if the location description expression already
+ doesn't end with DW_OP_piece. */
+
+static void
+add_loc_descr_op_piece (dw_loc_descr_ref *list_head, int size)
+{
+ dw_loc_descr_ref loc;
+
+ if (*list_head != NULL)
+ {
+ /* Find the end of the chain. */
+ for (loc = *list_head; loc->dw_loc_next != NULL; loc = loc->dw_loc_next)
+ ;
+
+ if (loc->dw_loc_opc != DW_OP_piece)
+ loc->dw_loc_next = new_loc_descr (DW_OP_piece, size, 0);
+ }
+}
+
/* Return a location descriptor that designates a machine register or
zero if there is none. */
if (die != NULL && die->die_parent == NULL)
add_child_die (context_die, die);
+ /* Do not produce debug information for static variables since
+ these might be optimized out. We are called for these later
+ in cgraph_varpool_analyze_pending_decls. */
+ if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ ;
else
gen_decl_die (decl, context_die);
}
if (DECL_EXTERNAL (decl) && !TREE_USED (decl))
return;
+ /* For local statics lookup proper context die. */
+ if (TREE_STATIC (decl) && decl_function_context (decl))
+ context_die = lookup_decl_die (DECL_CONTEXT (decl));
+
/* If we are in terse mode, don't generate any DIEs to represent any
variable declarations or definitions. */
if (debug_info_level <= DINFO_LEVEL_TERSE)