abg-ir.cc: Tidy some operator== definitions
Many of the operator== definitions in this source file follow the same
pattern:
- the address of the argument is dynamic_cast to type of 'this'
- naked canonical type pointers are compared, if both present
- the types are compared structurally with 'equals'
In a couple of cases extra work is done to fetch the canonical type
of the definition of a declaration.
This commit adjusts a few cases so they more closely follow the common
form. This is to make the next refactoring trivial.
There are no behavioural changes.
* src/abg-irc.cc (scope_type_decl::operator==): Compare naked
canonical type pointers instead of the shared pointers.
(qualified_type_def::operator==): Remove excess blank line.
(function_type::operator==): Do dynamic_cast and check of
argument before comparing naked canonical type pointers.
(class_or_union::operator==): Eliminate temporary reference.
(class_decl::operator==): Likewise.
(union_decl::operator==): Likewise.
Signed-off-by: Giuliano Procida <gprocida@google.com>
1 file changed