summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MustExecute.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-11-06 09:07:03 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-11-06 09:07:03 +0000
commit4855b74f8bbcb996dfb7f28174c4d8777843bab0 (patch)
treefd97f7ce6c2c8d42d9ec6fa71016f572a84e3461 /llvm/lib/Analysis/MustExecute.cpp
parentb1501462e2ecbd2c31b19a270c2e9c800dda6c3d (diff)
downloadbcm5719-llvm-4855b74f8bbcb996dfb7f28174c4d8777843bab0.tar.gz
bcm5719-llvm-4855b74f8bbcb996dfb7f28174c4d8777843bab0.zip
[NFC] Turn collectTransitivePredecessors into a static function
llvm-svn: 346217
Diffstat (limited to 'llvm/lib/Analysis/MustExecute.cpp')
-rw-r--r--llvm/lib/Analysis/MustExecute.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MustExecute.cpp b/llvm/lib/Analysis/MustExecute.cpp
index 7507aebb527..23e012626e2 100644
--- a/llvm/lib/Analysis/MustExecute.cpp
+++ b/llvm/lib/Analysis/MustExecute.cpp
@@ -145,9 +145,12 @@ static bool CanProveNotTakenFirstIteration(const BasicBlock *ExitBlock,
return SimpleCst->isAllOnesValue();
}
-void LoopSafetyInfo::collectTransitivePredecessors(
+/// Collect all blocks from \p CurLoop which lie on all possible paths from
+/// the header of \p CurLoop (inclusive) to BB (exclusive) into the set
+/// \p Predecessors. If \p BB is the header, \p Predecessors will be empty.
+static void collectTransitivePredecessors(
const Loop *CurLoop, const BasicBlock *BB,
- SmallPtrSetImpl<const BasicBlock *> &Predecessors) const {
+ SmallPtrSetImpl<const BasicBlock *> &Predecessors) {
assert(Predecessors.empty() && "Garbage in predecessors set?");
assert(CurLoop->contains(BB) && "Should only be called for loop blocks!");
if (BB == CurLoop->getHeader())
OpenPOWER on IntegriCloud