Skip to content

Commit 595f3e9

Browse files
[mlir][IR][NFC] PostDominanceInfo: Mark all functions as const (#115597)
Same as `DominanceInfo`, all functions should be `const`.
1 parent e375c0f commit 595f3e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

mlir/include/mlir/IR/Dominance.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,20 +202,20 @@ class PostDominanceInfo : public detail::DominanceInfoBase</*IsPostDom=*/true> {
202202
using super::super;
203203

204204
/// Return true if operation A properly postdominates operation B.
205-
bool properlyPostDominates(Operation *a, Operation *b);
205+
bool properlyPostDominates(Operation *a, Operation *b) const;
206206

207207
/// Return true if operation A postdominates operation B.
208-
bool postDominates(Operation *a, Operation *b) {
208+
bool postDominates(Operation *a, Operation *b) const {
209209
return a == b || properlyPostDominates(a, b);
210210
}
211211

212212
/// Return true if the specified block A properly postdominates block B.
213-
bool properlyPostDominates(Block *a, Block *b) {
213+
bool properlyPostDominates(Block *a, Block *b) const {
214214
return super::properlyDominates(a, b);
215215
}
216216

217217
/// Return true if the specified block A postdominates block B.
218-
bool postDominates(Block *a, Block *b) {
218+
bool postDominates(Block *a, Block *b) const {
219219
return a == b || properlyPostDominates(a, b);
220220
}
221221
};

mlir/lib/IR/Dominance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ bool DominanceInfo::properlyDominates(Value a, Operation *b) const {
327327
//===----------------------------------------------------------------------===//
328328

329329
/// Returns true if statement 'a' properly postdominates statement b.
330-
bool PostDominanceInfo::properlyPostDominates(Operation *a, Operation *b) {
330+
bool PostDominanceInfo::properlyPostDominates(Operation *a,
331+
Operation *b) const {
331332
auto *aBlock = a->getBlock(), *bBlock = b->getBlock();
332333
assert(aBlock && bBlock && "operations must be in a block");
333334

0 commit comments

Comments
 (0)