diff options
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 041b39aad09..0471213b69c 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -620,10 +620,8 @@ bool LoopInfo::invalidate(Function &F, const PreservedAnalyses &PA, void LoopInfo::erase(Loop *Unloop) { assert(!Unloop->isInvalid() && "Loop has already been erased!"); - RemovedLoops.push_back(Unloop); - auto InvalidateOnExit = - make_scope_exit([&]() { BaseT::clearLoop(*Unloop); }); + auto InvalidateOnExit = make_scope_exit([&]() { destroy(Unloop); }); // First handle the special case of no parent loop to simplify the algorithm. if (!Unloop->getParentLoop()) { |