[PATCH] D110394: [NFC] Mark LI.getLoopsInPreorder and LI.getLoopsInReverseSiblingPreorder const.
Joachim Meyer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 24 02:58:31 PDT 2021
fodinabor created this revision.
fodinabor added reviewers: RKSimon, fhahn, efriedma, kazu.
fodinabor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
They create a new vector with the list, so they can be const.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D110394
Files:
llvm/include/llvm/Analysis/LoopInfo.h
llvm/include/llvm/Analysis/LoopInfoImpl.h
Index: llvm/include/llvm/Analysis/LoopInfoImpl.h
===================================================================
--- llvm/include/llvm/Analysis/LoopInfoImpl.h
+++ llvm/include/llvm/Analysis/LoopInfoImpl.h
@@ -574,7 +574,7 @@
}
template <class BlockT, class LoopT>
-SmallVector<LoopT *, 4> LoopInfoBase<BlockT, LoopT>::getLoopsInPreorder() {
+SmallVector<LoopT *, 4> LoopInfoBase<BlockT, LoopT>::getLoopsInPreorder() const {
SmallVector<LoopT *, 4> PreOrderLoops, PreOrderWorklist;
// The outer-most loop actually goes into the result in the same relative
// order as we walk it. But LoopInfo stores the top level loops in reverse
@@ -592,7 +592,7 @@
template <class BlockT, class LoopT>
SmallVector<LoopT *, 4>
-LoopInfoBase<BlockT, LoopT>::getLoopsInReverseSiblingPreorder() {
+LoopInfoBase<BlockT, LoopT>::getLoopsInReverseSiblingPreorder() const {
SmallVector<LoopT *, 4> PreOrderLoops, PreOrderWorklist;
// The outer-most loop actually goes into the result in the same relative
// order as we walk it. LoopInfo stores the top level loops in reverse
Index: llvm/include/llvm/Analysis/LoopInfo.h
===================================================================
--- llvm/include/llvm/Analysis/LoopInfo.h
+++ llvm/include/llvm/Analysis/LoopInfo.h
@@ -950,7 +950,7 @@
///
/// Note that because loops form a forest of trees, preorder is equivalent to
/// reverse postorder.
- SmallVector<LoopT *, 4> getLoopsInPreorder();
+ SmallVector<LoopT *, 4> getLoopsInPreorder() const;
/// Return all of the loops in the function in preorder across the loop
/// nests, with siblings in *reverse* program order.
@@ -960,7 +960,7 @@
///
/// Also note that this is *not* a reverse preorder. Only the siblings are in
/// reverse program order.
- SmallVector<LoopT *, 4> getLoopsInReverseSiblingPreorder();
+ SmallVector<LoopT *, 4> getLoopsInReverseSiblingPreorder() const;
/// Return the inner most loop that BB lives in. If a basic block is in no
/// loop (for example the entry node), null is returned.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110394.374777.patch
Type: text/x-patch
Size: 2061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210924/e884a134/attachment.bin>
More information about the llvm-commits
mailing list