Instead of building a private numbering of MBB's use brg's nifty auto-numbering.
authorChris Lattner <sabre@nondot.org>
Thu, 1 Jul 2004 04:24:29 +0000 (04:24 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 1 Jul 2004 04:24:29 +0000 (04:24 +0000)
Also convert df_iterator -> df_ext_iterator for subsequent stuff I'm doing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14517 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveVariables.cpp

index 5898cb225562f73d666df0868e2e7ea343e21dc0..80fab5c4155a6715f2a592e56f81bbb12e9b1462 100644 (file)
@@ -178,9 +178,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
   }
 
   // Build BBMap... 
-  unsigned BBNum = 0;
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
-    BBMap[I] = BBNum++;
+    BBMap[I] = I->getNumber();
 
   // PhysRegInfo - Keep track of which instruction was the last use of a
   // physical register.  This is a purely local property, because all physical
@@ -201,8 +200,9 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
   // nodes, which are treated as a special case).
   //
   MachineBasicBlock *Entry = MF.begin();
-  for (df_iterator<MachineBasicBlock*> DFI = df_begin(Entry), E = df_end(Entry);
-       DFI != E; ++DFI) {
+  std::set<MachineBasicBlock*> Visited;
+  for (df_ext_iterator<MachineBasicBlock*> DFI = df_ext_begin(Entry, Visited),
+         E = df_ext_end(Entry, Visited); DFI != E; ++DFI) {
     MachineBasicBlock *MBB = *DFI;
     unsigned BBNum = getMachineBasicBlockIndex(MBB);
 
@@ -310,7 +310,7 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
         RegistersKilled.insert(std::make_pair(VirtRegInfo[i].Kills[j].second,
                                i + MRegisterInfo::FirstVirtualRegister));
     }
-  
+
   return false;
 }