Use an existing function.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Dec 2011 00:51:12 +0000 (00:51 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 6 Dec 2011 00:51:12 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145883 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index 3e3a4134c70447ac6ea38d69d220b3ed3fae2899..fedbbad56fafdb78834787eb718302d17343e985 100644 (file)
@@ -747,16 +747,7 @@ MachineBasicBlock *ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) {
   ++NumSplit;
 
   // Update the CFG.  All succs of OrigBB are now succs of NewBB.
-  while (!OrigBB->succ_empty()) {
-    MachineBasicBlock *Succ = *OrigBB->succ_begin();
-    OrigBB->removeSuccessor(Succ);
-    NewBB->addSuccessor(Succ);
-
-    // This pass should be run after register allocation, so there should be no
-    // PHI nodes to update.
-    assert((Succ->empty() || !Succ->begin()->isPHI())
-           && "PHI nodes should be eliminated by now!");
-  }
+  NewBB->transferSuccessors(OrigBB);
 
   // OrigBB branches to NewBB.
   OrigBB->addSuccessor(NewBB);