aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVar/BBLiveVar.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-28 18:01:21 +0000
committerChris Lattner <sabre@nondot.org>2002-10-28 18:01:21 +0000
commit601fc7c71c252e7d5748ecb64a1600ab1e333b5d (patch)
tree86fc4aaed895ff71a6c87496a984b8484233fca4 /lib/Analysis/LiveVar/BBLiveVar.cpp
parentb84a2ba877c670af013056c514fc80a56845fb87 (diff)
Eliminate uses of MachineBasicBlock::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/BBLiveVar.cpp')
-rw-r--r--lib/Analysis/LiveVar/BBLiveVar.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp
index 54de63e58f..4b07ebc632 100644
--- a/lib/Analysis/LiveVar/BBLiveVar.cpp
+++ b/lib/Analysis/LiveVar/BBLiveVar.cpp
@@ -18,8 +18,9 @@ using std::cerr;
static AnnotationID AID(AnnotationManager::getID("Analysis::BBLiveVar"));
-BBLiveVar *BBLiveVar::CreateOnBB(const BasicBlock &BB, unsigned POID) {
- BBLiveVar *Result = new BBLiveVar(BB, POID);
+BBLiveVar *BBLiveVar::CreateOnBB(const BasicBlock &BB, MachineBasicBlock &MBB,
+ unsigned POID) {
+ BBLiveVar *Result = new BBLiveVar(BB, MBB, POID);
BB.addAnnotation(Result);
return Result;
}
@@ -34,8 +35,8 @@ void BBLiveVar::RemoveFromBB(const BasicBlock &BB) {
}
-BBLiveVar::BBLiveVar(const BasicBlock &bb, unsigned id)
- : Annotation(AID), BB(bb), POID(id) {
+BBLiveVar::BBLiveVar(const BasicBlock &bb, MachineBasicBlock &mbb, unsigned id)
+ : Annotation(AID), BB(bb), MBB(mbb), POID(id) {
InSetChanged = OutSetChanged = false;
calcDefUseSets();
@@ -49,15 +50,12 @@ BBLiveVar::BBLiveVar(const BasicBlock &bb, unsigned id)
//-----------------------------------------------------------------------------
void BBLiveVar::calcDefUseSets() {
- // get the iterator for machine instructions
- const MachineBasicBlock &MIVec = MachineBasicBlock::get(&BB);
-
// iterate over all the machine instructions in BB
- for (MachineBasicBlock::const_reverse_iterator MII = MIVec.rbegin(),
- MIE = MIVec.rend(); MII != MIE; ++MII) {
+ for (MachineBasicBlock::const_reverse_iterator MII = MBB.rbegin(),
+ MIE = MBB.rend(); MII != MIE; ++MII) {
const MachineInstr *MI = *MII;
- if (DEBUG_LV >= LV_DEBUG_Verbose) { // debug msg
+ if (DEBUG_LV >= LV_DEBUG_Verbose) {
cerr << " *Iterating over machine instr ";
MI->dump();
cerr << "\n";