summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysisSummary.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysisSummary.h')
-rw-r--r--llvm/lib/Analysis/AliasAnalysisSummary.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisSummary.h b/llvm/lib/Analysis/AliasAnalysisSummary.h
index 43c0d4cb14f..ebd205a33df 100644
--- a/llvm/lib/Analysis/AliasAnalysisSummary.h
+++ b/llvm/lib/Analysis/AliasAnalysisSummary.h
@@ -120,6 +120,19 @@ inline bool operator==(InterfaceValue LHS, InterfaceValue RHS) {
inline bool operator!=(InterfaceValue LHS, InterfaceValue RHS) {
return !(LHS == RHS);
}
+inline bool operator<(InterfaceValue LHS, InterfaceValue RHS) {
+ return LHS.Index < RHS.Index ||
+ (LHS.Index == RHS.Index && LHS.DerefLevel < RHS.DerefLevel);
+}
+inline bool operator>(InterfaceValue LHS, InterfaceValue RHS) {
+ return RHS < LHS;
+}
+inline bool operator<=(InterfaceValue LHS, InterfaceValue RHS) {
+ return !(RHS < LHS);
+}
+inline bool operator>=(InterfaceValue LHS, InterfaceValue RHS) {
+ return !(LHS < RHS);
+}
/// We use ExternalRelation to describe an externally visible aliasing relations
/// between parameters/return value of a function.
@@ -127,6 +140,25 @@ struct ExternalRelation {
InterfaceValue From, To;
};
+inline bool operator==(ExternalRelation LHS, ExternalRelation RHS) {
+ return LHS.From == RHS.From && LHS.To == RHS.To;
+}
+inline bool operator!=(ExternalRelation LHS, ExternalRelation RHS) {
+ return !(LHS == RHS);
+}
+inline bool operator<(ExternalRelation LHS, ExternalRelation RHS) {
+ return LHS.From < RHS.From || (LHS.From == RHS.From && LHS.To < RHS.To);
+}
+inline bool operator>(ExternalRelation LHS, ExternalRelation RHS) {
+ return RHS < LHS;
+}
+inline bool operator<=(ExternalRelation LHS, ExternalRelation RHS) {
+ return !(RHS < LHS);
+}
+inline bool operator>=(ExternalRelation LHS, ExternalRelation RHS) {
+ return !(LHS < RHS);
+}
+
/// We use ExternalAttribute to describe an externally visible AliasAttrs
/// for parameters/return value.
struct ExternalAttribute {
OpenPOWER on IntegriCloud