summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-23 20:39:18 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-23 20:39:18 +0000
commit232db6e8d645360a9773e2617af9546ed32ac82c (patch)
treef58454ca3c7a5436480d1c89761e3327b578900c
parent537132bf129163343200fe6805ce43077fda233b (diff)
downloadllvm-232db6e8d645360a9773e2617af9546ed32ac82c.tar.gz
llvm-232db6e8d645360a9773e2617af9546ed32ac82c.tar.bz2
llvm-232db6e8d645360a9773e2617af9546ed32ac82c.tar.xz
Move the implementations of ==, != on AllocInfos here, from UnpackTraceFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9452 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegAlloc/AllocInfo.h9
-rw-r--r--lib/Target/SparcV9/RegAlloc/AllocInfo.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAlloc/AllocInfo.h b/lib/CodeGen/RegAlloc/AllocInfo.h
index ad230506fb..d982afc8ef 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 ad230506fb..d982afc8ef 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