[llvm] r218736 - InstrProf: Make coverage::Counter comparable

Justin Bogner mail at justinbogner.com
Tue Sep 30 20:31:59 PDT 2014


Author: bogner
Date: Tue Sep 30 22:31:58 2014
New Revision: 218736

URL: http://llvm.org/viewvc/llvm-project?rev=218736&view=rev
Log:
InstrProf: Make coverage::Counter comparable

I'll be using this in a clang change very soon.

Modified:
    llvm/trunk/include/llvm/ProfileData/CoverageMapping.h

Modified: llvm/trunk/include/llvm/ProfileData/CoverageMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/CoverageMapping.h?rev=218736&r1=218735&r2=218736&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/CoverageMapping.h Tue Sep 30 22:31:58 2014
@@ -63,6 +63,10 @@ public:
     return Kind == Other.Kind && ID == Other.ID;
   }
 
+  friend bool operator<(const Counter &LHS, const Counter &RHS) {
+    return std::tie(LHS.Kind, LHS.ID) < std::tie(RHS.Kind, RHS.ID);
+  }
+
   /// \brief Return the counter that represents the number zero.
   static Counter getZero() { return Counter(); }
 





More information about the llvm-commits mailing list