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 | a48b100da70c707c35ed54d92189ffb534e05803 (patch) | |
tree | 83bd07a1b1269a2489873eeff06244d7bc34a0e3 /lib/CodeGen/LiveVariables.cpp | |
parent | 2883c2d6830a334dab3fa2edc78c4a0f5a8b0711 (diff) | |
download | external_llvm-a48b100da70c707c35ed54d92189ffb534e05803.tar.gz external_llvm-a48b100da70c707c35ed54d92189ffb534e05803.tar.bz2 external_llvm-a48b100da70c707c35ed54d92189ffb534e05803.zip |
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/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 632cd8210a..9fe42f644d 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/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"; |