[llvm] r228242 - IR: Rename 'operator ==()' to 'isKeyOf()', NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Wed Feb 4 16:51:36 PST 2015


Author: dexonsmith
Date: Wed Feb  4 18:51:35 2015
New Revision: 228242

URL: http://llvm.org/viewvc/llvm-project?rev=228242&view=rev
Log:
IR: Rename 'operator ==()' to 'isKeyOf()', NFC

`isKeyOf()` is a clearer name than overloading `operator==()`.

Modified:
    llvm/trunk/lib/IR/LLVMContextImpl.h

Modified: llvm/trunk/lib/IR/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=228242&r1=228241&r2=228242&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/IR/LLVMContextImpl.h Wed Feb  4 18:51:35 2015
@@ -219,7 +219,7 @@ template <> struct MDNodeKeyImpl<MDTuple
   MDNodeKeyImpl(ArrayRef<Metadata *> Ops) : MDNodeOpsKey(Ops) {}
   MDNodeKeyImpl(const MDTuple *N) : MDNodeOpsKey(N) {}
 
-  bool operator==(const MDTuple *RHS) const { return compareOps(RHS); }
+  bool isKeyOf(const MDTuple *RHS) const { return compareOps(RHS); }
 
   unsigned getHashValue() const { return getHash(); }
 
@@ -243,7 +243,7 @@ template <> struct MDNodeKeyImpl<MDLocat
       : Line(L->getLine()), Column(L->getColumn()), Scope(L->getScope()),
         InlinedAt(L->getInlinedAt()) {}
 
-  bool operator==(const MDLocation *RHS) const {
+  bool isKeyOf(const MDLocation *RHS) const {
     return Line == RHS->getLine() && Column == RHS->getColumn() &&
            Scope == RHS->getScope() && InlinedAt == RHS->getInlinedAt();
   }
@@ -261,7 +261,7 @@ template <> struct MDNodeKeyImpl<Generic
   MDNodeKeyImpl(const GenericDebugNode *N)
       : MDNodeOpsKey(N, 1), Tag(N->getTag()), Header(N->getHeader()) {}
 
-  bool operator==(const GenericDebugNode *RHS) const {
+  bool isKeyOf(const GenericDebugNode *RHS) const {
     return Tag == RHS->getTag() && Header == RHS->getHeader() &&
            compareOps(RHS, 1);
   }
@@ -289,7 +289,7 @@ template <class NodeTy> struct MDNodeInf
   static bool isEqual(const KeyTy &LHS, const NodeTy *RHS) {
     if (RHS == getEmptyKey() || RHS == getTombstoneKey())
       return false;
-    return LHS == RHS;
+    return LHS.isKeyOf(RHS);
   }
   static bool isEqual(const NodeTy *LHS, const NodeTy *RHS) {
     return LHS == RHS;





More information about the llvm-commits mailing list