summaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-08-11 17:54:58 +0000
committerAndrew Trick <atrick@apple.com>2011-08-11 17:54:58 +0000
commit5c1ff1f2f27cb0701b9768c7ef0f944849616888 (patch)
treee559d822728448e66f9dd63cbb409e4c1dbb117c /lib/Analysis/LoopInfo.cpp
parentf8fce711e8b756adca63044f7d122648c960ab96 (diff)
downloadllvm-5c1ff1f2f27cb0701b9768c7ef0f944849616888.tar.gz
llvm-5c1ff1f2f27cb0701b9768c7ef0f944849616888.tar.bz2
llvm-5c1ff1f2f27cb0701b9768c7ef0f944849616888.tar.xz
Cleanup. Another thorough review by Nick!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index 6bebae5740..7bbe506fe1 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -471,8 +471,8 @@ void UnloopUpdater::updateBlockParents() {
/// nested within unloop.
void UnloopUpdater::updateSubloopParents() {
while (!Unloop->empty()) {
- Loop *Subloop = *(Unloop->end()-1);
- Unloop->removeChildLoop(Unloop->end()-1);
+ Loop *Subloop = *llvm::prior(Unloop->end());
+ Unloop->removeChildLoop(llvm::prior(Unloop->end()));
assert(SubloopParents.count(Subloop) && "DFS failed to visit subloop");
if (SubloopParents[Subloop])
@@ -487,8 +487,8 @@ void UnloopUpdater::updateSubloopParents() {
/// For subloop blocks, simply update SubloopParents and return NULL.
Loop *UnloopUpdater::getNearestLoop(BasicBlock *BB, Loop *BBLoop) {
- // Initialy for blocks directly contained by Unloop, NearLoop == Unloop and is
- // considered uninitialized.
+ // Initially for blocks directly contained by Unloop, NearLoop == Unloop and
+ // is considered uninitialized.
Loop *NearLoop = BBLoop;
Loop *Subloop = 0;
@@ -562,7 +562,7 @@ bool LoopInfo::runOnFunction(Function &) {
/// updateUnloop - The last backedge has been removed from a loop--now the
/// "unloop". Find a new parent for the blocks contained within unloop and
-/// update the loop tree. We don't necessarilly have valid dominators at this
+/// update the loop tree. We don't necessarily have valid dominators at this
/// point, but LoopInfo is still valid except for the removal of this loop.
///
/// Note that Unloop may now be an empty loop. Calling Loop::getHeader without
@@ -595,7 +595,7 @@ void LoopInfo::updateUnloop(Loop *Unloop) {
// Move all of the subloops to the top-level.
while (!Unloop->empty())
- LI.addTopLevelLoop(Unloop->removeChildLoop(Unloop->end()-1));
+ LI.addTopLevelLoop(Unloop->removeChildLoop(llvm::prior(Unloop->end())));
return;
}