[PATCH] D22816: Move assert as early as possible.

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 20:37:43 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL276830: Move assert as early as possible (authored by spop).

Changed prior to commit:
  https://reviews.llvm.org/D22816?vs=65539&id=65655#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22816

Files:
  llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h

Index: llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h
+++ llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h
@@ -252,6 +252,8 @@
         HasInsideLoopSuccs = true;
         break;
       }
+    assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!");
+
     typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
     for (typename InvBlockTraits::ChildIteratorType PI =
            InvBlockTraits::child_begin(BB), PE = InvBlockTraits::child_end(BB);
@@ -262,6 +264,7 @@
       else
         OutsideLoopPreds.push_back(N);
     }
+    assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!");
 
     if (BB == getHeader()) {
         assert(!OutsideLoopPreds.empty() && "Loop is unreachable!");
@@ -275,8 +278,6 @@
           assert(CB != OutsideLoopPreds[i] &&
                  "Loop has multiple entry points!");
     }
-    assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!");
-    assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!");
     assert(BB != &getHeader()->getParent()->front() &&
            "Loop contains function entry block!");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22816.65655.patch
Type: text/x-patch
Size: 1236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/0d8114ac/attachment.bin>


More information about the llvm-commits mailing list