Move the implementations of ==, != on AllocInfos here, from UnpackTraceFunction.
authorBrian Gaeke <gaeke@uiuc.edu>
Thu, 23 Oct 2003 20:39:18 +0000 (20:39 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Thu, 23 Oct 2003 20:39:18 +0000 (20:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9452 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/AllocInfo.h
lib/Target/SparcV9/RegAlloc/AllocInfo.h

index ad230506fb37506e9381cac92f48267238148326..d982afc8ef08e506f807f6fe01ac418d65bd930b 100644 (file)
@@ -56,6 +56,15 @@ struct AllocInfo {
     CV.push_back (ConstantSInt::get (Type::IntTy, Placement));
     return ConstantStruct::get (ST, CV);
   }
+
+  /// AllocInfos compare equal if the allocation placements are equal
+  /// (i.e., they can be equal even if they refer to operands from two
+  /// different instructions.)
+  ///
+  bool operator== (const AllocInfo &X) const {
+    return (X.AllocState == AllocState) && (X.Placement == Placement);
+  } 
+  bool operator!= (const AllocInfo &X) const { return !(*this == X); } 
 };
 
 #endif // ALLOCINFO_H
index ad230506fb37506e9381cac92f48267238148326..d982afc8ef08e506f807f6fe01ac418d65bd930b 100644 (file)
@@ -56,6 +56,15 @@ struct AllocInfo {
     CV.push_back (ConstantSInt::get (Type::IntTy, Placement));
     return ConstantStruct::get (ST, CV);
   }
+
+  /// AllocInfos compare equal if the allocation placements are equal
+  /// (i.e., they can be equal even if they refer to operands from two
+  /// different instructions.)
+  ///
+  bool operator== (const AllocInfo &X) const {
+    return (X.AllocState == AllocState) && (X.Placement == Placement);
+  } 
+  bool operator!= (const AllocInfo &X) const { return !(*this == X); } 
 };
 
 #endif // ALLOCINFO_H