Implement David Blaikie's suggestion for comparison operators

llvm-svn: 314822
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 7a4694f..554a751 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -116,10 +116,15 @@
     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;
   }
-  bool operator!=(const DbgValueLocation &O) const { return !(*this == O); }
+
+  friend inline bool operator!=(const DbgValueLocation &LHS,
+                                const DbgValueLocation &RHS) {
+    return !(LHS == RHS);
+  }
 
 private:
   unsigned LocNo : 31;