diff --git a/include/abg-ir.h b/include/abg-ir.h index 9ca083c0..dca0d12a 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -2326,6 +2326,7 @@ public: uint64_t get_unsigned_value(); void set_unsigned(uint64_t v); void set_signed(int64_t v); + bool operator==(const bound_value&) const; }; //end class bound_value /// Hasher for an instance of array::subrange diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 516e34b9..a78889ab 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -14738,6 +14738,17 @@ array_type_def::subrange_type::bound_value::set_signed(int64_t v) v_.signed_ = v; } +/// Equality operator of the bound value. +/// +/// @param v the other bound value to compare with. +/// +/// @return true iff the current bound value equals @p v. +bool +array_type_def::subrange_type::bound_value::operator==(const bound_value& v) const +{ + return s_ == v.s_ && v_.unsigned_ == v.v_.unsigned_; +} + // struct array_type_def::subrange_type::priv