From 38e17e0e071e79d551fdf614c1878751380ca1a8 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 2 Oct 2015 17:05:23 +0200 Subject: [PATCH] Cleanup some IR type comparison operators * include/abg-ir.h (operator==): In the overloads for type_decl, enum and class_decl, turn the shared_ptr parameter into a const reference to the shared_ptr. * src/abg-ir.cc (operator==): Do the same in the definitions. Signed-off-by: Dodji Seketeli --- include/abg-ir.h | 6 +++--- src/abg-ir.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/abg-ir.h b/include/abg-ir.h index 925c6c0c..9998e0cd 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -1326,7 +1326,7 @@ bool equals(const scope_type_decl&, const scope_type_decl&, change_kind*); bool -operator==(type_decl_sptr, type_decl_sptr); +operator==(const type_decl_sptr&, const type_decl_sptr&); /// A type that introduces a scope. class scope_type_decl : public scope_decl, public virtual type_base @@ -1761,7 +1761,7 @@ public: }; // end class enum_type_decl bool -operator==(enum_type_decl_sptr l, enum_type_decl_sptr r); +operator==(const enum_type_decl_sptr& l, const enum_type_decl_sptr& r); /// The abstraction of an enumerator class enum_type_decl::enumerator { @@ -2939,7 +2939,7 @@ std::ostream& operator<<(std::ostream&, access_specifier); bool -operator==(class_decl_sptr l, class_decl_sptr r); +operator==(const class_decl_sptr& l, const class_decl_sptr& r); /// The base class for member types, data members and member /// functions. Its purpose is mainly to carry the access specifier diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 4e0c96fd..d4b4405e 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -5985,7 +5985,7 @@ type_decl::operator==(const type_decl& o) const /// /// @return true iff @p l equals @p r. bool -operator==(type_decl_sptr l, type_decl_sptr r) +operator==(const type_decl_sptr& l, const type_decl_sptr& r) { if (!!l != !!r) return false; @@ -7452,7 +7452,7 @@ enum_type_decl::operator==(const type_base& o) const /// /// @return true iff @p l equals @p r. bool -operator==(enum_type_decl_sptr l, enum_type_decl_sptr r) +operator==(const enum_type_decl_sptr& l, const enum_type_decl_sptr& r) { if (!!l != !!r) return false; @@ -10919,7 +10919,7 @@ class_decl::operator==(const class_decl& other) const /// @return true if the class_decl pointed to by the shared_ptrs are /// equal, false otherwise. bool -operator==(class_decl_sptr l, class_decl_sptr r) +operator==(const class_decl_sptr& l, const class_decl_sptr& r) { if (l.get() == r.get()) return true;