[llvm] 0c77171 - [LoopIterator] Add const qualifier to LoopInfo (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 02:10:54 PDT 2023
Author: Nikita Popov
Date: 2023-09-27T11:10:46+02:00
New Revision: 0c77171da00fc57bb50018090c06ffbb9b93c505
URL: https://github.com/llvm/llvm-project/commit/0c77171da00fc57bb50018090c06ffbb9b93c505
DIFF: https://github.com/llvm/llvm-project/commit/0c77171da00fc57bb50018090c06ffbb9b93c505.diff
LOG: [LoopIterator] Add const qualifier to LoopInfo (NFC)
Loop iteration utilities do not change LoopInfo.
Added:
Modified:
llvm/include/llvm/Analysis/LoopIterator.h
llvm/lib/Analysis/LoopInfo.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/LoopIterator.h b/llvm/include/llvm/Analysis/LoopIterator.h
index 360f196a80daf4b..523d2a21825d0dd 100644
--- a/llvm/include/llvm/Analysis/LoopIterator.h
+++ b/llvm/include/llvm/Analysis/LoopIterator.h
@@ -120,7 +120,7 @@ class LoopBlocksDFS {
Loop *getLoop() const { return L; }
/// Traverse the loop blocks and store the DFS result.
- void perform(LoopInfo *LI);
+ void perform(const LoopInfo *LI);
/// Return true if postorder numbers are assigned to all loop blocks.
bool isComplete() const { return PostBlocks.size() == L->getNumBlocks(); }
@@ -177,7 +177,7 @@ class LoopBlocksRPO {
LoopBlocksRPO(Loop *Container) : DFS(Container) {}
/// Traverse the loop blocks and store the DFS result.
- void perform(LoopInfo *LI) {
+ void perform(const LoopInfo *LI) {
DFS.perform(LI);
}
@@ -204,10 +204,10 @@ class LoopBlocksTraversal {
private:
LoopBlocksDFS &DFS;
- LoopInfo *LI;
+ const LoopInfo *LI;
public:
- LoopBlocksTraversal(LoopBlocksDFS &Storage, LoopInfo *LInfo) :
+ LoopBlocksTraversal(LoopBlocksDFS &Storage, const LoopInfo *LInfo) :
DFS(Storage), LI(LInfo) {}
/// Postorder traversal over the graph. This only needs to be done once.
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 60a72079e864c1e..7567efbedfb027a 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -1218,7 +1218,7 @@ PreservedAnalyses LoopVerifierPass::run(Function &F,
/// Traverse the loop blocks and store the DFS result.
/// Useful for clients that just want the final DFS result and don't need to
/// visit blocks during the initial traversal.
-void LoopBlocksDFS::perform(LoopInfo *LI) {
+void LoopBlocksDFS::perform(const LoopInfo *LI) {
LoopBlocksTraversal Traversal(*this, LI);
for (LoopBlocksTraversal::POTIterator POI = Traversal.begin(),
POE = Traversal.end();
More information about the llvm-commits
mailing list