LoopInfo: Simplify ownership of Loop objects
authorJustin Bogner <mail@justinbogner.com>
Fri, 8 Jan 2016 19:08:53 +0000 (19:08 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 8 Jan 2016 19:08:53 +0000 (19:08 +0000)
commitfbbc16fa87defddc1d6eecb56e609a8ae6438ed1
treedd5890512392f1ef2d66fb847eead29c5332bb4c
parent432ca7460b008060245c92e1a4c3ff4cf787e0ce
LoopInfo: Simplify ownership of Loop objects

It's strange that LoopInfo mostly owns the Loop objects, but that it
defers deleting them to the loop pass manager. Instead, change the
oddly named "updateUnloop" to "markAsRemoved" and have it queue the
Loop object for deletion. We can't delete the Loop immediately when we
remove it, since we need its pointer identity still, so we'll mark the
object as "invalid" so that clients can see what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257191 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopInfo.h
lib/Analysis/LoopInfo.cpp
lib/Analysis/LoopPass.cpp
lib/Transforms/IPO/LoopExtractor.cpp
lib/Transforms/Scalar/LoopDeletion.cpp
lib/Transforms/Utils/LoopUnroll.cpp
test/Transforms/LoopUnroll/unloop.ll