From d16e7d93840552959d89afecba419a78972c0125 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Tue, 6 Nov 2018 09:07:03 +0000 Subject: [PATCH] [NFC] Turn collectTransitivePredecessors into a static function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346217 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/MustExecute.h | 7 ------- lib/Analysis/MustExecute.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/llvm/Analysis/MustExecute.h b/include/llvm/Analysis/MustExecute.h index c4005a9af95..05c28d13988 100644 --- a/include/llvm/Analysis/MustExecute.h +++ b/include/llvm/Analysis/MustExecute.h @@ -49,13 +49,6 @@ class LoopSafetyInfo { // Used to update funclet bundle operands. DenseMap BlockColors; - /// 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. - void collectTransitivePredecessors( - const Loop *CurLoop, const BasicBlock *BB, - SmallPtrSetImpl &Predecessors) const; - protected: /// Computes block colors. void computeBlockColors(const Loop *CurLoop); diff --git a/lib/Analysis/MustExecute.cpp b/lib/Analysis/MustExecute.cpp index 7507aebb527..23e012626e2 100644 --- a/lib/Analysis/MustExecute.cpp +++ b/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 &Predecessors) const { + SmallPtrSetImpl &Predecessors) { assert(Predecessors.empty() && "Garbage in predecessors set?"); assert(CurLoop->contains(BB) && "Should only be called for loop blocks!"); if (BB == CurLoop->getHeader()) -- 2.11.4.GIT