static dw_loc_descr_ref based_loc_descr (rtx, HOST_WIDE_INT,
enum var_init_status);
static int is_based_loc (const_rtx);
-static int resolve_one_addr (rtx *, void *);
+static bool resolve_one_addr (rtx *);
static dw_loc_descr_ref concat_loc_descriptor (rtx, rtx,
enum var_init_status);
static dw_loc_descr_ref loc_descriptor (rtx, enum machine_mode mode,
break;
case CONST_STRING:
- resolve_one_addr (&rtl, NULL);
+ resolve_one_addr (&rtl);
goto symref;
default:
if (dwarf_version >= 4 || !dwarf_strict)
{
dw_loc_descr_ref loc_result;
- resolve_one_addr (&rtl, NULL);
+ resolve_one_addr (&rtl);
rtl_addr:
loc_result = new_addr_loc_descr (rtl, dtprel_false);
add_loc_descr (&loc_result, new_loc_descr (DW_OP_stack_value, 0, 0));
}
/* Helper function for resolve_addr, attempt to resolve
- one CONST_STRING, return non-zero if not successful. Similarly verify that
+ one CONST_STRING, return true if successful. Similarly verify that
SYMBOL_REFs refer to variables emitted in the current CU. */
-static int
-resolve_one_addr (rtx *addr, void *data ATTRIBUTE_UNUSED)
+static bool
+resolve_one_addr (rtx *addr)
{
rtx rtl = *addr;
= build_array_type (char_type_node, build_index_type (tlen));
rtl = lookup_constant_def (t);
if (!rtl || !MEM_P (rtl))
- return 1;
+ return false;
rtl = XEXP (rtl, 0);
if (GET_CODE (rtl) == SYMBOL_REF
&& SYMBOL_REF_DECL (rtl)
&& !TREE_ASM_WRITTEN (SYMBOL_REF_DECL (rtl)))
- return 1;
+ return false;
vec_safe_push (used_rtx_array, rtl);
*addr = rtl;
- return 0;
+ return true;
}
if (GET_CODE (rtl) == SYMBOL_REF
if (TREE_CONSTANT_POOL_ADDRESS_P (rtl))
{
if (!TREE_ASM_WRITTEN (DECL_INITIAL (SYMBOL_REF_DECL (rtl))))
- return 1;
+ return false;
}
else if (!TREE_ASM_WRITTEN (SYMBOL_REF_DECL (rtl)))
- return 1;
+ return false;
}
- if (GET_CODE (rtl) == CONST
- && for_each_rtx (&XEXP (rtl, 0), resolve_one_addr, NULL))
- return 1;
+ if (GET_CODE (rtl) == CONST)
+ {
+ subrtx_ptr_iterator::array_type array;
+ FOR_EACH_SUBRTX_PTR (iter, array, &XEXP (rtl, 0), ALL)
+ if (!resolve_one_addr (*iter))
+ return false;
+ }
- return 0;
+ return true;
}
/* For STRING_CST, return SYMBOL_REF of its constant pool entry,
switch (loc->dw_loc_opc)
{
case DW_OP_addr:
- if (resolve_one_addr (&loc->dw_loc_oprnd1.v.val_addr, NULL))
+ if (!resolve_one_addr (&loc->dw_loc_oprnd1.v.val_addr))
{
if ((prev == NULL
|| prev->dw_loc_opc == DW_OP_piece
|| (loc->dw_loc_opc == DW_OP_GNU_const_index && loc->dtprel))
{
rtx rtl = loc->dw_loc_oprnd1.val_entry->addr.rtl;
- if (resolve_one_addr (&rtl, NULL))
+ if (!resolve_one_addr (&rtl))
return false;
remove_addr_table_entry (loc->dw_loc_oprnd1.val_entry);
loc->dw_loc_oprnd1.val_entry =
case DW_OP_const4u:
case DW_OP_const8u:
if (loc->dtprel
- && resolve_one_addr (&loc->dw_loc_oprnd1.v.val_addr, NULL))
+ && !resolve_one_addr (&loc->dw_loc_oprnd1.v.val_addr))
return false;
break;
case DW_OP_plus_uconst:
break;
case DW_OP_implicit_value:
if (loc->dw_loc_oprnd2.val_class == dw_val_class_addr
- && resolve_one_addr (&loc->dw_loc_oprnd2.v.val_addr, NULL))
+ && !resolve_one_addr (&loc->dw_loc_oprnd2.v.val_addr))
return false;
break;
case DW_OP_GNU_implicit_pointer:
break;
case dw_val_class_addr:
if (a->dw_attr == DW_AT_const_value
- && resolve_one_addr (&a->dw_attr_val.v.val_addr, NULL))
+ && !resolve_one_addr (&a->dw_attr_val.v.val_addr))
{
if (AT_index (a) != NOT_INDEXED)
remove_addr_table_entry (a->dw_attr_val.val_entry);