diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/RegAlloc/AllocInfo.h | 9 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/AllocInfo.h | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAlloc/AllocInfo.h b/lib/CodeGen/RegAlloc/AllocInfo.h index ad23050..d982afc 100644 --- a/lib/CodeGen/RegAlloc/AllocInfo.h +++ b/lib/CodeGen/RegAlloc/AllocInfo.h @@ -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 diff --git a/lib/Target/SparcV9/RegAlloc/AllocInfo.h b/lib/Target/SparcV9/RegAlloc/AllocInfo.h index ad23050..d982afc 100644 --- a/lib/Target/SparcV9/RegAlloc/AllocInfo.h +++ b/lib/Target/SparcV9/RegAlloc/AllocInfo.h @@ -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 |