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 | 8fed4ce0b823b65b79fd8f5c10f1d8689a37326f (patch) | |
tree | 8ab2e401915f066c5898b5174d1d90e9f54f8ab5 /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | 7d5389e4b3820605e158cbcd4dd1d33711d96b4d (diff) | |
download | llvm-8fed4ce0b823b65b79fd8f5c10f1d8689a37326f.zip llvm-8fed4ce0b823b65b79fd8f5c10f1d8689a37326f.tar.gz llvm-8fed4ce0b823b65b79fd8f5c10f1d8689a37326f.tar.bz2 |
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/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index 632cd82..9fe42f6 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/lib/CodeGen/LiveVariables.cpp @@ -52,11 +52,11 @@ void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const { void LiveVariables::VarInfo::dump() const { cerr << " Alive in blocks: "; - for (unsigned i = 0, e = AliveBlocks.size(); i != e; ++i) - if (AliveBlocks[i]) cerr << i << ", "; + for (int i = AliveBlocks.find_first(); i != -1; i = AliveBlocks.find_next(i)) + cerr << i << ", "; cerr << " Used in blocks: "; - for (unsigned i = 0, e = UsedBlocks.size(); i != e; ++i) - if (UsedBlocks[i]) cerr << i << ", "; + for (int i = UsedBlocks.find_first(); i != -1; i = UsedBlocks.find_next(i)) + cerr << i << ", "; cerr << "\n Killed by:"; if (Kills.empty()) cerr << " No instructions.\n"; |