-/* Return DIE offset of ATTR. Return 0 with complaint if ATTR is not of the
- required kind. */
-
-static sect_offset
-dwarf2_get_ref_die_offset (const struct attribute *attr)
-{
- if (attr->form_is_ref ())
- return (sect_offset) DW_UNSND (attr);
-
- complaint (_("unsupported die ref attribute form: '%s'"),
- dwarf_form_name (attr->form));
- return {};
-}
-
-/* Return the constant value held by ATTR. Return DEFAULT_VALUE if
- * the value held by the attribute is not constant. */
-
-static LONGEST
-dwarf2_get_attr_constant_value (const struct attribute *attr, int default_value)
-{
- if (attr->form == DW_FORM_sdata || attr->form == DW_FORM_implicit_const)
- return DW_SND (attr);
- else if (attr->form == DW_FORM_udata
- || attr->form == DW_FORM_data1
- || attr->form == DW_FORM_data2
- || attr->form == DW_FORM_data4
- || attr->form == DW_FORM_data8)
- return DW_UNSND (attr);
- else
- {
- /* For DW_FORM_data16 see attribute::form_is_constant. */
- complaint (_("Attribute value is not a constant (%s)"),
- dwarf_form_name (attr->form));
- return default_value;
- }
-}
-