Skip to content

Commit c6cec7b

Browse files
[CodeGen] Make hash_value a non-friend function (NFC) (#137564)
We can implement hash_value with publicly available methods of Vector.
1 parent d3d856a commit c6cec7b

File tree

1 file changed

+1
-3
lines changed
  • llvm/include/llvm/CodeGen/PBQP

1 file changed

+1
-3
lines changed

llvm/include/llvm/CodeGen/PBQP/Math.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ using PBQPNum = float;
2525

2626
/// PBQP Vector class.
2727
class Vector {
28-
friend hash_code hash_value(const Vector &);
29-
3028
public:
3129
/// Construct a PBQP vector of the given size.
3230
explicit Vector(unsigned Length) : Data(Length) {}
@@ -96,7 +94,7 @@ class Vector {
9694
inline hash_code hash_value(const Vector &V) {
9795
const unsigned *VBegin = reinterpret_cast<const unsigned *>(V.begin());
9896
const unsigned *VEnd = reinterpret_cast<const unsigned *>(V.end());
99-
return hash_combine(V.Data.size(), hash_combine_range(VBegin, VEnd));
97+
return hash_combine(V.getLength(), hash_combine_range(VBegin, VEnd));
10098
}
10199

102100
/// Output a textual representation of the given vector on the given

0 commit comments

Comments
 (0)