ContainerType&
get_container(const read_context& ctxt, const Dwarf_Die *die)
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
return get_container(source);
}
Dwarf_Die &canonical_die,
bool die_as_type) const
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
-
- ABG_ASSERT(get_die_source(die, source));
+ const die_source source = get_die_source(die);
Dwarf_Off die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
size_t where,
bool die_as_type) const
{
- die_source source;
- ABG_ASSERT(get_die_source(die, source));
+ const die_source source = get_die_source(die);
offset_offset_map_type &canonical_dies =
die_as_type
size_t where,
bool die_as_type) const
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(get_die_source(die, source));
+ const die_source source = get_die_source(die);
offset_offset_map_type &canonical_dies =
die_as_type
///
/// @param die the DIE to get the source of.
///
- /// @param source out parameter. The function sets this parameter
- /// to the source of the DIE @p iff it returns true.
- ///
- /// @return true iff the source of the DIE could be determined and
- /// returned.
- bool
- get_die_source(const Dwarf_Die *die, die_source &source) const
+ /// @return the source of the DIE if it could be determined,
+ /// NO_DEBUG_INFO_DIE_SOURCE otherwise.
+ die_source
+ get_die_source(const Dwarf_Die *die) const
{
+ die_source source = NO_DEBUG_INFO_DIE_SOURCE;
ABG_ASSERT(die);
- return get_die_source(*die, source);
+ ABG_ASSERT(get_die_source(*die, source));
+ return source;
}
/// Get the source of the DIE.
size_t where_offset,
bool do_associate_by_repr = false)
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(get_die_source(die, source));
+ const die_source source = get_die_source(die);
die_artefact_map_type& m =
decl_die_artefact_maps().get_container(source);
Dwarf_Off canonical_die_offset,
bool die_as_type) const
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(get_die_source(die, source));
+ const die_source source = get_die_source(die);
Dwarf_Off die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
schedule_type_for_late_canonicalization(const Dwarf_Die *die)
{
Dwarf_Off o;
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
Dwarf_Die equiv_die;
ABG_ASSERT(get_canonical_die(die, equiv_die,
/*where=*/0,
/*die_as_type=*/true));
- ABG_ASSERT(get_die_source(&equiv_die, source));
+ const die_source source = get_die_source(&equiv_die);
o = dwarf_dieoffset(&equiv_die);
const die_artefact_map_type& m =
Dwarf_Off l_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(l)),
r_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(r));
Dwarf_Off l_canonical_die_offset = 0, r_canonical_die_offset = 0;
- die_source l_die_source = NO_DEBUG_INFO_DIE_SOURCE,
- r_die_source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(l, l_die_source));
- ABG_ASSERT(ctxt.get_die_source(r, r_die_source));
+ const die_source l_die_source = ctxt.get_die_source(l);
+ const die_source r_die_source = ctxt.get_die_source(r);
// If 'l' and 'r' already have canonical DIEs, then just compare the
// offsets of their canonical DIEs.
//
// In case 'r' has no canonical DIE, then compute it, and then
// propagate that canonical DIE to 'r'.
- die_source l_source = NO_DEBUG_INFO_DIE_SOURCE,
- r_source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(l, l_source));
- ABG_ASSERT(ctxt.get_die_source(r, r_source));
+ const die_source l_source = ctxt.get_die_source(l);
+ const die_source r_source = ctxt.get_die_source(r);
+
if (!l_has_canonical_die_offset
// A DIE can be equivalent only to another DIE of the same
// source.
{
ABG_ASSERT(ctxt.dwarf());
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
const offset_offset_map_type& m = ctxt.die_parent_map(source);
offset_offset_map_type::const_iterator i =
bool called_for_public_decl,
size_t where_offset)
{
- die_source source_of_die = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source_of_die));
+ const die_source source_of_die = ctxt.get_die_source(die);
if (is_c_language(ctxt.cur_transl_unit()->get_language()))
{
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_namespace && tag != DW_TAG_module)
return result;
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_union_type)
return result;
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
{
die_class_or_union_map_type::const_iterator i =
ctxt.die_wip_classes_map(source).find(dwarf_dieoffset(die));
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_const_type
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_pointer_type)
return result;
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_reference_type
&& tag != DW_TAG_rvalue_reference_type)
ABG_ASSERT(dwarf_tag(die) == DW_TAG_subroutine_type
|| dwarf_tag(die) == DW_TAG_subprogram);
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
decl_base_sptr type_decl;
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(const_cast<Dwarf_Die*>(die));
if (tag != DW_TAG_subrange_type)
return result;
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_array_type)
return result;
if (!die)
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
unsigned tag = dwarf_tag(die);
if (tag != DW_TAG_typedef)
return result;
if (!die_is_public_decl(die))
return result;
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
type_base_sptr type;
Dwarf_Die type_die;
if (die_die_attribute(die, DW_AT_type, type_die))
return result;
ABG_ASSERT(dwarf_tag(die) == DW_TAG_subprogram);
- die_source source;
- ABG_ASSERT(ctxt.get_die_source(die, source));
-
if (!die_is_public_decl(die))
return result;
static void
maybe_canonicalize_type(const Dwarf_Die *die, read_context& ctxt)
{
- die_source source = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source));
+ const die_source source = ctxt.get_die_source(die);
size_t die_offset = dwarf_dieoffset(const_cast<Dwarf_Die*>(die));
type_base_sptr t = ctxt.lookup_type_from_die(die);
return result;
}
- die_source source_of_die = NO_DEBUG_INFO_DIE_SOURCE;
- ABG_ASSERT(ctxt.get_die_source(die, source_of_die));
+ const die_source source_of_die = ctxt.get_die_source(die);
if ((result = ctxt.lookup_decl_from_die_offset(dwarf_dieoffset(die),
source_of_die)))