Remove FIXME about asserting on the end iterator
authorReid Kleckner <rnk@google.com>
Thu, 11 Aug 2016 16:00:43 +0000 (16:00 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 11 Aug 2016 16:00:43 +0000 (16:00 +0000)
After machine block placement, MBBs may not have terminators, and it is
appropriate to check for the end iterator here. We can fold the check
into the next if, as well. This look is really just looking for BBs that
end in CATCHRET.

llvm-svn: 278350

llvm/lib/CodeGen/Analysis.cpp

index 9fb29b8..ebbcaeb 100644 (file)
@@ -695,13 +695,9 @@ llvm::getFuncletMembership(const MachineFunction &MF) {
 
     MachineBasicBlock::const_iterator MBBI = MBB.getFirstTerminator();
 
-    // FIXME: Should this be an assertion?  It fires all over in X86.
-    if (MBBI == MBB.end())
-      continue;
-
     // CatchPads are not funclets for SEH so do not consider CatchRet to
     // transfer control to another funclet.
-    if (MBBI->getOpcode() != TII->getCatchReturnOpcode())
+    if (MBBI == MBB.end() || MBBI->getOpcode() != TII->getCatchReturnOpcode())
       continue;
 
     // FIXME: SEH CatchPads are not necessarily in the parent function: