diff options
author | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:12:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-06-25 16:12:52 +0000 |
commit | 18961504fc2b299578dba817900a0696cf3ccc4d (patch) | |
tree | c34853ffc064b841932d0897e25305c81c3a7338 /lib/Analysis/LiveVar/BBLiveVar.cpp | |
parent | a2204e1ff25265a1da00ecbb3ebb22c05acf7194 (diff) | |
download | external_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.gz external_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.bz2 external_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.zip |
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/BBLiveVar.cpp')
-rw-r--r-- | lib/Analysis/LiveVar/BBLiveVar.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp index 7d735b79e4..eb58671a79 100644 --- a/lib/Analysis/LiveVar/BBLiveVar.cpp +++ b/lib/Analysis/LiveVar/BBLiveVar.cpp @@ -18,23 +18,23 @@ using std::cerr; static AnnotationID AID(AnnotationManager::getID("Analysis::BBLiveVar")); -BBLiveVar *BBLiveVar::CreateOnBB(const BasicBlock *BB, unsigned POID) { +BBLiveVar *BBLiveVar::CreateOnBB(const BasicBlock &BB, unsigned POID) { BBLiveVar *Result = new BBLiveVar(BB, POID); - BB->addAnnotation(Result); + BB.addAnnotation(Result); return Result; } -BBLiveVar *BBLiveVar::GetFromBB(const BasicBlock *BB) { - return (BBLiveVar*)BB->getAnnotation(AID); +BBLiveVar *BBLiveVar::GetFromBB(const BasicBlock &BB) { + return (BBLiveVar*)BB.getAnnotation(AID); } -void BBLiveVar::RemoveFromBB(const BasicBlock *BB) { - bool Deleted = BB->deleteAnnotation(AID); +void BBLiveVar::RemoveFromBB(const BasicBlock &BB) { + bool Deleted = BB.deleteAnnotation(AID); assert(Deleted && "BBLiveVar annotation did not exist!"); } -BBLiveVar::BBLiveVar(const BasicBlock *bb, unsigned id) +BBLiveVar::BBLiveVar(const BasicBlock &bb, unsigned id) : Annotation(AID), BB(bb), POID(id) { InSetChanged = OutSetChanged = false; @@ -50,7 +50,7 @@ BBLiveVar::BBLiveVar(const BasicBlock *bb, unsigned id) void BBLiveVar::calcDefUseSets() { // get the iterator for machine instructions - const MachineCodeForBasicBlock &MIVec = BB->getMachineInstrVec(); + const MachineCodeForBasicBlock &MIVec = BB.getMachineInstrVec(); // iterate over all the machine instructions in BB for (MachineCodeForBasicBlock::const_reverse_iterator MII = MIVec.rbegin(), @@ -129,7 +129,7 @@ void BBLiveVar::calcDefUseSets() { //----------------------------------------------------------------------------- // To add an operand which is a def //----------------------------------------------------------------------------- -void BBLiveVar::addDef(const Value *Op) { +void BBLiveVar::addDef(const Value *Op) { DefSet.insert(Op); // operand is a def - so add to def set InSet.erase(Op); // this definition kills any later uses InSetChanged = true; @@ -211,9 +211,9 @@ bool BBLiveVar::applyFlowFunc() { // bool needAnotherIt = false; - for (pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB); + for (pred_const_iterator PI = pred_begin(&BB), PE = pred_end(&BB); PI != PE ; ++PI) { - BBLiveVar *PredLVBB = BBLiveVar::GetFromBB(*PI); + BBLiveVar *PredLVBB = BBLiveVar::GetFromBB(**PI); // do set union if (setPropagate(&PredLVBB->OutSet, &InSet, *PI)) { |