In class_or_union::set_is_declaration_only we should update the type
lookup maps only when a class type that was previously a
declaration-only type is now a defined type. Otherwise, updating the type
lookup maps is unnecessary and profiling shows that it takes a
significant amount of time.
This patch does away with the unnecessary attempts to update type
lookup maps.
* src/abg-ir.cc (class_or_union::get_is_declaration_only): Try
to update the type maps only when a declaration-only class
type is now defined.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
void
class_or_union::set_is_declaration_only(bool f)
{
+ bool update_types_lookup_map = !f && priv_->is_declaration_only_;
+
priv_->is_declaration_only_ = f;
- if (!f)
+
+ if (update_types_lookup_map)
if (scope_decl* s = get_scope())
{
declarations::iterator i;
if (s->find_iterator_for_member(this, i))
maybe_update_types_lookup_map(*i);
else
- abort();
+ ABG_ASSERT_NOT_REACHED;
}
}