summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-10-03 18:30:11 +0000
committerReid Kleckner <rnk@google.com>2017-10-03 18:30:11 +0000
commitb4569de7393ea4fbdc8d5a19e0c0e91c4db09351 (patch)
tree8665d2f929dfd6cfbd883d4d10bd13f74e365d91 /llvm/lib
parent660531085a5e8c1bd8253f4802eb056b91d14875 (diff)
downloadbcm5719-llvm-b4569de7393ea4fbdc8d5a19e0c0e91c4db09351.tar.gz
bcm5719-llvm-b4569de7393ea4fbdc8d5a19e0c0e91c4db09351.zip
Implement David Blaikie's suggestion for comparison operators
llvm-svn: 314822
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 7a4694f9663..554a7511ed8 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;
OpenPOWER on IntegriCloud