InstrProf: Add operator!= to coverage counters
authorJustin Bogner <mail@justinbogner.com>
Sat, 24 Jan 2015 21:13:23 +0000 (21:13 +0000)
committerJustin Bogner <mail@justinbogner.com>
Sat, 24 Jan 2015 21:13:23 +0000 (21:13 +0000)
I'll use this in clang shortly. Also makes the operator definition
style more consistent in this class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227018 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/CoverageMapping.h

index 5a6b97974979a8833612011aef3850595e8efe6c..7c88977cb29e02f311fea21b88fd9490855f4543 100644 (file)
@@ -63,8 +63,12 @@ public:
 
   unsigned getExpressionID() const { return ID; }
 
-  bool operator==(const Counter &Other) const {
-    return Kind == Other.Kind && ID == Other.ID;
+  friend bool operator==(const Counter &LHS, const Counter &RHS) {
+    return LHS.Kind == RHS.Kind && LHS.ID == RHS.ID;
+  }
+
+  friend bool operator!=(const Counter &LHS, const Counter &RHS) {
+    return !(LHS == RHS);
   }
 
   friend bool operator<(const Counter &LHS, const Counter &RHS) {