Skip to content

Commit b4569de

Browse files
committed
Implement David Blaikie's suggestion for comparison operators
llvm-svn: 314822
1 parent 6605310 commit b4569de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

llvm/lib/CodeGen/LiveDebugVariables.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,15 @@ class DbgValueLocation {
116116
return DbgValueLocation(NewLocNo, WasIndirect);
117117
}
118118

119-
bool operator==(const DbgValueLocation &O) const {
120-
return LocNo == O.LocNo && WasIndirect == O.WasIndirect;
119+
friend inline bool operator==(const DbgValueLocation &LHS,
120+
const DbgValueLocation &RHS) {
121+
return LHS.LocNo == RHS.LocNo && LHS.WasIndirect == RHS.WasIndirect;
122+
}
123+
124+
friend inline bool operator!=(const DbgValueLocation &LHS,
125+
const DbgValueLocation &RHS) {
126+
return !(LHS == RHS);
121127
}
122-
bool operator!=(const DbgValueLocation &O) const { return !(*this == O); }
123128

124129
private:
125130
unsigned LocNo : 31;

0 commit comments

Comments
 (0)