OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
334df9d
)
BitVector::count() bugs.
author
Evan Cheng
<evan.cheng@apple.com>
Thu, 15 Feb 2007 19:09:36 +0000
(19:09 +0000)
committer
Evan Cheng
<evan.cheng@apple.com>
Thu, 15 Feb 2007 19:09:36 +0000
(19:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34314
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/BitVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/BitVector.h
b/include/llvm/ADT/BitVector.h
index
a6ae1ac
..
03789aa
100644
(file)
--- a/
include/llvm/ADT/BitVector.h
+++ b/
include/llvm/ADT/BitVector.h
@@
-101,7
+101,12
@@
public:
unsigned count() const {
unsigned NumBits = 0;
for (unsigned i = 0; i < NumBitWords(size()); ++i)
- NumBits = CountPopulation_32(Bits[i]);
+ if (sizeof(BitWord) == 4)
+ NumBits += CountPopulation_32(Bits[i]);
+ else if (sizeof(BitWord) == 8)
+ NumBits += CountPopulation_64(Bits[i]);
+ else
+ assert(0 && "Unsupported!")
return NumBits;
}