fix operator!=
This commit is contained in:
@@ -508,13 +508,13 @@ AccessingSet AccessingSet::Diff(const AccessingSet& secondSet) const
|
||||
return uncovered;
|
||||
}
|
||||
|
||||
bool operator==(const ArrayDimension& lhs, const ArrayDimension& rhs)
|
||||
bool operator!=(const ArrayDimension& lhs, const ArrayDimension& rhs)
|
||||
{
|
||||
return lhs.start == rhs.start && lhs.step == rhs.step && lhs.tripCount == rhs.tripCount;
|
||||
return !(lhs.start == rhs.start && lhs.step == rhs.step && lhs.tripCount == rhs.tripCount);
|
||||
}
|
||||
|
||||
|
||||
bool operator==(const AccessingSet& lhs, const AccessingSet& rhs)
|
||||
bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs)
|
||||
{
|
||||
for (size_t i = 0; i < lhs.allElements.size(); i++)
|
||||
{
|
||||
@@ -522,11 +522,27 @@ bool operator==(const AccessingSet& lhs, const AccessingSet& rhs)
|
||||
{
|
||||
if (lhs.allElements[i][j] != rhs.allElements[i][j])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator!=(const ArrayAccessingIndexes& lhs, const ArrayAccessingIndexes& rhs)
|
||||
{
|
||||
if(lhs.size() != rhs.size())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
for(auto& [key, value]: lhs)
|
||||
{
|
||||
if(rhs.find(key) == rhs.end())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Collapse(Region* region)
|
||||
|
||||
@@ -30,7 +30,7 @@ class AccessingSet {
|
||||
bool ContainsElement(const vector<ArrayDimension>& element) const;
|
||||
void FindCoveredBy(const vector<ArrayDimension>& element, vector<vector<ArrayDimension>>& result) const;
|
||||
void FindUncovered(const vector<ArrayDimension>& element, vector<vector<ArrayDimension>>& result) const;
|
||||
friend bool operator==(const AccessingSet& lhs, const AccessingSet& rhs);
|
||||
friend bool operator!=(const AccessingSet& lhs, const AccessingSet& rhs);
|
||||
};
|
||||
|
||||
using ArrayAccessingIndexes = map<string, AccessingSet>;
|
||||
|
||||
Reference in New Issue
Block a user