diff options
author | Dan Gohman <gohman@apple.com> | 2008-11-13 16:31:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-11-13 16:31:27 +0000 |
commit | 4a829ecc54cdcb0192550639556a18728af5119c (patch) | |
tree | 83bd07a1b1269a2489873eeff06244d7bc34a0e3 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 023422a6eb9ea692a5a837dc1daf256ac75ac6b0 (diff) |
Use find_first/find_next to iterate through all the set bits in a
BitVector, instead of manually testing each bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 1709618037..a51291298b 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -399,14 +399,13 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // Iterate over all of the blocks that the variable is completely // live in, adding [insrtIndex(begin), instrIndex(end)+4) to the // live interval. - for (unsigned i = 0, e = vi.AliveBlocks.size(); i != e; ++i) { - if (vi.AliveBlocks[i]) { - LiveRange LR(getMBBStartIdx(i), - getMBBEndIdx(i)+1, // MBB ends at -1. - ValNo); - interval.addRange(LR); - DOUT << " +" << LR; - } + for (int i = vi.AliveBlocks.find_first(); i != -1; + i = vi.AliveBlocks.find_next(i)) { + LiveRange LR(getMBBStartIdx(i), + getMBBEndIdx(i)+1, // MBB ends at -1. + ValNo); + interval.addRange(LR); + DOUT << " +" << LR; } // Finally, this virtual register is live from the start of any killing |