Enhance finalizeBundle to return end of bundle iterator because it makes sense.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 19 Jan 2012 06:13:10 +0000 (06:13 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 19 Jan 2012 06:13:10 +0000 (06:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148462 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstrBundle.h
lib/CodeGen/MachineInstrBundle.cpp

index 8189507a9e3ce7b1f5ec9cae0993b1912dced679..2beddc1b3e44154777eb3a6c9c8912a8e11acd4a 100644 (file)
@@ -32,8 +32,9 @@ void finalizeBundle(MachineBasicBlock &MBB,
 /// finalizeBundle - Same functionality as the previous finalizeBundle except
 /// the last instruction in the bundle is not provided as an input. This is
 /// used in cases where bundles are pre-determined by marking instructions
-/// with 'InsideBundle' marker.
-void finalizeBundle(MachineBasicBlock &MBB,
+/// with 'InsideBundle' marker. It returns the MBB instruction iterator that
+/// points to the end of the bundle.
+MachineBasicBlock::instr_iterator finalizeBundle(MachineBasicBlock &MBB,
                     MachineBasicBlock::instr_iterator FirstMI);
 
 } // End llvm namespace
index 7873fd0bdf34847bfbc05d3210476a09b85bee92..23dc796b338eb7c00bec106d1dad33b688c82eda 100644 (file)
@@ -184,12 +184,15 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
 /// finalizeBundle - Same functionality as the previous finalizeBundle except
 /// the last instruction in the bundle is not provided as an input. This is
 /// used in cases where bundles are pre-determined by marking instructions
-/// with 'InsideBundle' marker.
-void llvm::finalizeBundle(MachineBasicBlock &MBB,
-                          MachineBasicBlock::instr_iterator FirstMI) {
+/// with 'InsideBundle' marker. It returns the MBB instruction iterator that
+/// points to the end of the bundle.
+MachineBasicBlock::instr_iterator
+llvm::finalizeBundle(MachineBasicBlock &MBB,
+                     MachineBasicBlock::instr_iterator FirstMI) {
   MachineBasicBlock::instr_iterator E = MBB.instr_end();
   MachineBasicBlock::instr_iterator LastMI = llvm::next(FirstMI);
   while (LastMI != E && LastMI->isInsideBundle())
     ++LastMI;
   finalizeBundle(MBB, FirstMI, LastMI);
+  return LastMI;
 }