Skip to content

Commit caea72f

Browse files
[mlir][IR][NFC] PostDominanceInfo: Mark all functions as const
Same as `DominanceInfo`, all functions should be `const`. Depends on #115587.
1 parent 9979c63 commit caea72f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mlir/include/mlir/IR/Dominance.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,18 +196,18 @@ class PostDominanceInfo : public detail::DominanceInfoBase</*IsPostDom=*/true> {
196196

197197
/// Return true if operation A properly postdominates operation B.
198198
bool properlyPostDominates(Operation *a, Operation *b,
199-
bool enclosingOpOk = true);
199+
bool enclosingOpOk = true) const;
200200

201201
/// Return true if operation A postdominates operation B.
202-
bool postDominates(Operation *a, Operation *b) {
202+
bool postDominates(Operation *a, Operation *b) const {
203203
return a == b || properlyPostDominates(a, b);
204204
}
205205

206206
/// Return true if the specified block A properly postdominates block B.
207-
bool properlyPostDominates(Block *a, Block *b);
207+
bool properlyPostDominates(Block *a, Block *b) const;
208208

209209
/// Return true if the specified block A postdominates block B.
210-
bool postDominates(Block *a, Block *b) {
210+
bool postDominates(Block *a, Block *b) const {
211211
return a == b || properlyPostDominates(a, b);
212212
}
213213
};

mlir/lib/IR/Dominance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ bool DominanceInfo::properlyDominates(Value a, Operation *b) const {
352352
//===----------------------------------------------------------------------===//
353353

354354
bool PostDominanceInfo::properlyPostDominates(Operation *a, Operation *b,
355-
bool enclosingOpOk) {
355+
bool enclosingOpOk) const {
356356
return super::properlyDominatesImpl(a->getBlock(), a->getIterator(),
357357
b->getBlock(), b->getIterator(),
358358
enclosingOpOk);
359359
}
360360

361-
bool PostDominanceInfo::properlyPostDominates(Block *a, Block *b) {
361+
bool PostDominanceInfo::properlyPostDominates(Block *a, Block *b) const {
362362
return super::properlyDominatesImpl(a, a->end(), b, b->end(),
363363
/*enclosingOk=*/true);
364364
}

0 commit comments

Comments
 (0)