From b4569de7393ea4fbdc8d5a19e0c0e91c4db09351 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 3 Oct 2017 18:30:11 +0000 Subject: [PATCH] Implement David Blaikie's suggestion for comparison operators llvm-svn: 314822 --- llvm/lib/CodeGen/LiveDebugVariables.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 7a4694f96635..554a7511ed87 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -116,10 +116,15 @@ public: return DbgValueLocation(NewLocNo, WasIndirect); } - bool operator==(const DbgValueLocation &O) const { - return LocNo == O.LocNo && WasIndirect == O.WasIndirect; + friend inline bool operator==(const DbgValueLocation &LHS, + const DbgValueLocation &RHS) { + return LHS.LocNo == RHS.LocNo && LHS.WasIndirect == RHS.WasIndirect; + } + + friend inline bool operator!=(const DbgValueLocation &LHS, + const DbgValueLocation &RHS) { + return !(LHS == RHS); } - bool operator!=(const DbgValueLocation &O) const { return !(*this == O); } private: unsigned LocNo : 31;