summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-01 04:24:29 +0000
committerChris Lattner <sabre@nondot.org>2004-07-01 04:24:29 +0000
commit7c77fd50e7e523640ba2d8ae6c49c78dab9f6712 (patch)
tree666b66b02a678d6eabd70a2419e6389f1498a2f0 /llvm/lib/CodeGen/LiveVariables.cpp
parent5cc223a7e26d3beab0e6771f17b235cc2718be1d (diff)
downloadbcm5719-llvm-7c77fd50e7e523640ba2d8ae6c49c78dab9f6712.tar.gz
bcm5719-llvm-7c77fd50e7e523640ba2d8ae6c49c78dab9f6712.zip
Instead of building a private numbering of MBB's use brg's nifty auto-numbering.
Also convert df_iterator -> df_ext_iterator for subsequent stuff I'm doing. llvm-svn: 14517
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 5898cb22556..80fab5c4155 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -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;
}
OpenPOWER on IntegriCloud