Skip to content

Commit a67072e

Browse files
iambrjGroverkss
authored andcommitted
[MLIR][Presburger] Fix incorrect doc comment and add const
1 parent 9aaf007 commit a67072e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ class PresburgerRelation {
8585
/// Return the intersection of this set and the given set.
8686
PresburgerRelation intersect(const PresburgerRelation &set) const;
8787

88-
/// Intersect the given `set` with the range in-place.
88+
/// Return the range intersection of the given `set` with `this` relation.
8989
///
9090
/// Formally, let the relation `this` be R: A -> B and `set` is C, then this
91-
/// operation modifies R to be A -> (B intersection C).
92-
PresburgerRelation intersectRange(PresburgerSet &set);
91+
/// operation returns A -> (B intersection C).
92+
PresburgerRelation intersectRange(const PresburgerSet &set) const;
9393

94-
/// Intersect the given `set` with the domain in-place.
94+
/// Return the domain intersection of the given `set` with `this` relation.
9595
///
9696
/// Formally, let the relation `this` be R: A -> B and `set` is C, then this
97-
/// operation modifies R to be (A intersection C) -> B.
98-
PresburgerRelation intersectDomain(const PresburgerSet &set);
97+
/// operation returns (A intersection C) -> B.
98+
PresburgerRelation intersectDomain(const PresburgerSet &set) const;
9999

100100
/// Invert the relation, i.e. swap its domain and range.
101101
///

mlir/lib/Analysis/Presburger/PresburgerRelation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ PresburgerRelation::intersect(const PresburgerRelation &set) const {
143143
return result;
144144
}
145145

146-
PresburgerRelation PresburgerRelation::intersectRange(PresburgerSet &set) {
146+
PresburgerRelation
147+
PresburgerRelation::intersectRange(const PresburgerSet &set) const {
147148
assert(space.getRangeSpace().isCompatible(set.getSpace()) &&
148149
"Range of `this` must be compatible with range of `set`");
149150

@@ -153,7 +154,7 @@ PresburgerRelation PresburgerRelation::intersectRange(PresburgerSet &set) {
153154
}
154155

155156
PresburgerRelation
156-
PresburgerRelation::intersectDomain(const PresburgerSet &set) {
157+
PresburgerRelation::intersectDomain(const PresburgerSet &set) const {
157158
assert(space.getDomainSpace().isCompatible(set.getSpace()) &&
158159
"Domain of `this` must be compatible with range of `set`");
159160

0 commit comments

Comments
 (0)