]> sourceware.org Git - libabigail.git/commit
abg-ir.cc: Refactor operator== methods with helper function
authorGiuliano Procida <gprocida@google.com>
Wed, 8 Jul 2020 09:53:14 +0000 (10:53 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 27 Jul 2020 13:26:03 +0000 (15:26 +0200)
commit0fd2fb93ebae36be91763a8003d12dbf2d5a7223
tree2f5dc119d980cd804325ad71eb22c13829ce2cd0
parentdfd8314159a36ff1ebc4b9daa64ec937c822511c
abg-ir.cc: Refactor operator== methods with helper function

Many of the operator== definitions in this source file follow the same
pattern:

- First, canonical comparison is attempted if canonical types are
  present.
- Otherwise, the comparison is performed structurally using the
  'equals' function.

This commit refactors the common logic into a templated helper
function named "try_canonical_compare".

There are no behavioural changes.

* src/abg-ir.cc (try_canonical_compare): New template function.
(type_decl::operator==): Use it here.
(scope_type_decl::operator==): Likewise.
(qualified_type_def::operator==): Likewise.
(pointer_type_def::operator==): Likewise.
(reference_type_def::operator==): Likewise.
(array_type_def::subrange_type::operator==): Likewise.
(array_type_def::operator==): Likewise.
(enum_type_decl::operator==): Likewise.
(typedef_decl::operator==): Likewise.
(function_type::operator==): Likewise.
(class_or_union::operator==): Likewise.
(class_decl::operator==): Likewise.
(union_decl::operator==): Likewise.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-ir.cc
This page took 0.029253 seconds and 5 git commands to generate.