[llvm] r236237 - Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps

Daniel Berlin dberlin at dberlin.org
Thu Apr 30 09:15:07 PDT 2015


Author: dannyb
Date: Thu Apr 30 11:15:07 2015
New Revision: 236237

URL: http://llvm.org/viewvc/llvm-project?rev=236237&view=rev
Log:
Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps

Modified:
    llvm/trunk/include/llvm/Analysis/AliasAnalysis.h

Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=236237&r1=236236&r2=236237&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Thu Apr 30 11:15:07 2015
@@ -134,6 +134,10 @@ public:
       Copy.AATags = AAMDNodes();
       return Copy;
     }
+
+    bool operator==(const AliasAnalysis::Location &Other) const {
+      return Ptr == Other.Ptr && Size == Other.Size && AATags == Other.AATags;
+    }
   };
 
   /// getLocation - Fill in Loc with information about the memory reference by
@@ -615,9 +619,7 @@ struct DenseMapInfo<AliasAnalysis::Locat
   }
   static bool isEqual(const AliasAnalysis::Location &LHS,
                       const AliasAnalysis::Location &RHS) {
-    return LHS.Ptr == RHS.Ptr &&
-           LHS.Size == RHS.Size &&
-           LHS.AATags == RHS.AATags;
+    return LHS == RHS;
   }
 };
 





More information about the llvm-commits mailing list