diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-05 06:02:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-05 06:02:59 +0000 |
commit | 2f898d207466bf233b55607e404baca302bc7b5e (patch) | |
tree | e7e8036f6881ebf092db953518b5b15ca9949edc /lib/Analysis/LiveVar/BBLiveVar.cpp | |
parent | 748697d2421051b3ff1263d13cccaf410f3e7034 (diff) |
Convert operand iterator over to work like an STL iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/BBLiveVar.cpp')
-rw-r--r-- | lib/Analysis/LiveVar/BBLiveVar.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.cpp b/lib/Analysis/LiveVar/BBLiveVar.cpp index 35548f6b2e..e4a8a51b54 100644 --- a/lib/Analysis/LiveVar/BBLiveVar.cpp +++ b/lib/Analysis/LiveVar/BBLiveVar.cpp @@ -45,7 +45,8 @@ void BBLiveVar::calcDefUseSets() { } // iterate over MI operands to find defs - for (MachineInstr::val_const_op_iterator OpI(MI); !OpI.done(); ++OpI) + for (MachineInstr::const_val_op_iterator OpI = MI->begin(), OpE = MI->end(); + OpI != OpE; ++OpI) if (OpI.isDef()) // add to Defs only if this operand is a def addDef(*OpI); @@ -57,10 +58,11 @@ void BBLiveVar::calcDefUseSets() { bool IsPhi = MI->getOpCode() == PHI; // iterate over MI operands to find uses - for (MachineInstr::val_const_op_iterator OpI(MI); !OpI.done(); ++OpI) { + for (MachineInstr::const_val_op_iterator OpI = MI->begin(), OpE = MI->end(); + OpI != OpE; ++OpI) { const Value *Op = *OpI; - if (Op->getType()->isLabelType()) + if (isa<BasicBlock>(Op)) continue; // don't process labels if (!OpI.isDef()) { // add to Defs only if this operand is a use |