struct attribute *decl_line = dwarf2_attr (die, DW_AT_decl_line, cu);
if (decl_line == nullptr)
return 0;
- if (decl_line->form_is_constant ())
- {
- LONGEST val = decl_line->constant_value (0);
- if (0 <= val && val <= UINT_MAX)
- return (unsigned int) val;
+ std::optional<ULONGEST> val = decl_line->unsigned_constant ();
+ if (val.has_value ())
+ {
+ if (*val <= UINT_MAX)
+ return (unsigned int) *val;
complaint (_("Declared line for using directive is too large"));
- return 0;
}
-
- complaint (_("Declared line for using directive is of incorrect format"));
return 0;
}
inlined_func ? DW_AT_call_line : DW_AT_decl_line,
cu);
if (attr != nullptr)
- sym->set_line (attr->constant_value (0));
+ sym->set_line (attr->unsigned_constant ().value_or (0));
struct dwarf2_cu *file_cu = cu;
attr = dwarf2_attr (die,