summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-13 16:31:27 +0000
committerDan Gohman <gohman@apple.com>2008-11-13 16:31:27 +0000
commit8fed4ce0b823b65b79fd8f5c10f1d8689a37326f (patch)
tree8ab2e401915f066c5898b5174d1d90e9f54f8ab5 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent7d5389e4b3820605e158cbcd4dd1d33711d96b4d (diff)
downloadbcm5719-llvm-8fed4ce0b823b65b79fd8f5c10f1d8689a37326f.tar.gz
bcm5719-llvm-8fed4ce0b823b65b79fd8f5c10f1d8689a37326f.zip
Use find_first/find_next to iterate through all the set bits in a
BitVector, instead of manually testing each bit. llvm-svn: 59246
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 1709618037c..a51291298b9 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud