From db7afdbb01137ae92a8bc6cf4b0a9acc5151a03d Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Sat, 24 Jan 2015 21:13:23 +0000 Subject: [PATCH] InstrProf: Add operator!= to coverage counters I'll use this in clang shortly. Also makes the operator definition style more consistent in this class. llvm-svn: 227018 --- llvm/include/llvm/ProfileData/CoverageMapping.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ProfileData/CoverageMapping.h b/llvm/include/llvm/ProfileData/CoverageMapping.h index 5a6b97974979..7c88977cb29e 100644 --- a/llvm/include/llvm/ProfileData/CoverageMapping.h +++ b/llvm/include/llvm/ProfileData/CoverageMapping.h @@ -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) {