[llvm] r278350 - Remove FIXME about asserting on the end iterator

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 09:00:43 PDT 2016


Author: rnk
Date: Thu Aug 11 11:00:43 2016
New Revision: 278350

URL: http://llvm.org/viewvc/llvm-project?rev=278350&view=rev
Log:
Remove FIXME about asserting on the end iterator

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.

Modified:
    llvm/trunk/lib/CodeGen/Analysis.cpp

Modified: llvm/trunk/lib/CodeGen/Analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Analysis.cpp?rev=278350&r1=278349&r2=278350&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Analysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/Analysis.cpp Thu Aug 11 11:00:43 2016
@@ -695,13 +695,9 @@ llvm::getFuncletMembership(const Machine
 
     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:




More information about the llvm-commits mailing list