Skip to content

Commit 0c77171

Browse files
committed
[LoopIterator] Add const qualifier to LoopInfo (NFC)
Loop iteration utilities do not change LoopInfo.
1 parent ace20e2 commit 0c77171

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/include/llvm/Analysis/LoopIterator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class LoopBlocksDFS {
120120
Loop *getLoop() const { return L; }
121121

122122
/// Traverse the loop blocks and store the DFS result.
123-
void perform(LoopInfo *LI);
123+
void perform(const LoopInfo *LI);
124124

125125
/// Return true if postorder numbers are assigned to all loop blocks.
126126
bool isComplete() const { return PostBlocks.size() == L->getNumBlocks(); }
@@ -177,7 +177,7 @@ class LoopBlocksRPO {
177177
LoopBlocksRPO(Loop *Container) : DFS(Container) {}
178178

179179
/// Traverse the loop blocks and store the DFS result.
180-
void perform(LoopInfo *LI) {
180+
void perform(const LoopInfo *LI) {
181181
DFS.perform(LI);
182182
}
183183

@@ -204,10 +204,10 @@ class LoopBlocksTraversal {
204204

205205
private:
206206
LoopBlocksDFS &DFS;
207-
LoopInfo *LI;
207+
const LoopInfo *LI;
208208

209209
public:
210-
LoopBlocksTraversal(LoopBlocksDFS &Storage, LoopInfo *LInfo) :
210+
LoopBlocksTraversal(LoopBlocksDFS &Storage, const LoopInfo *LInfo) :
211211
DFS(Storage), LI(LInfo) {}
212212

213213
/// Postorder traversal over the graph. This only needs to be done once.

llvm/lib/Analysis/LoopInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ PreservedAnalyses LoopVerifierPass::run(Function &F,
12181218
/// Traverse the loop blocks and store the DFS result.
12191219
/// Useful for clients that just want the final DFS result and don't need to
12201220
/// visit blocks during the initial traversal.
1221-
void LoopBlocksDFS::perform(LoopInfo *LI) {
1221+
void LoopBlocksDFS::perform(const LoopInfo *LI) {
12221222
LoopBlocksTraversal Traversal(*this, LI);
12231223
for (LoopBlocksTraversal::POTIterator POI = Traversal.begin(),
12241224
POE = Traversal.end();

0 commit comments

Comments
 (0)