summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Levenstein <romix.llvm@googlemail.com>2009-01-26 11:07:20 +0000
committerRoman Levenstein <romix.llvm@googlemail.com>2009-01-26 11:07:20 +0000
commit179dd918b93b13c2eb7e9df1f05d4281c7b4250f (patch)
tree3be9d4549a678d2d680ed8cb2e8efdded8eb8f9b
parentb5fba6f8d8580dffeb0ee7bda8f48b5b4cd15c46 (diff)
downloadbcm5719-llvm-179dd918b93b13c2eb7e9df1f05d4281c7b4250f.tar.gz
bcm5719-llvm-179dd918b93b13c2eb7e9df1f05d4281c7b4250f.zip
Fix a bug in BitVector.h. All assignment operations (except the usual
assignment operator) were returning a copy of the bit vector, instead of a reference! This old semantics probably did not meet the expectations. With this patch, chained assignments happen to the right object. llvm-svn: 63012
-rw-r--r--llvm/include/llvm/ADT/BitVector.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h
index d92605b8193..23fde26e142 100644
--- a/llvm/include/llvm/ADT/BitVector.h
+++ b/llvm/include/llvm/ADT/BitVector.h
@@ -286,7 +286,7 @@ public:
}
// Intersection, union, disjoint union.
- BitVector operator&=(const BitVector &RHS) {
+ BitVector &operator&=(const BitVector &RHS) {
unsigned ThisWords = NumBitWords(size());
unsigned RHSWords = NumBitWords(RHS.size());
unsigned i;
@@ -302,14 +302,14 @@ public:
return *this;
}
- BitVector operator|=(const BitVector &RHS) {
+ BitVector &operator|=(const BitVector &RHS) {
assert(Size == RHS.Size && "Illegal operation!");
for (unsigned i = 0; i < NumBitWords(size()); ++i)
Bits[i] |= RHS.Bits[i];
return *this;
}
- BitVector operator^=(const BitVector &RHS) {
+ BitVector &operator^=(const BitVector &RHS) {
assert(Size == RHS.Size && "Illegal operation!");
for (unsigned i = 0; i < NumBitWords(size()); ++i)
Bits[i] ^= RHS.Bits[i];
OpenPOWER on IntegriCloud