Lines Matching refs:RHS

153   SmallBitVector(const SmallBitVector &RHS) {
154 if (RHS.isSmall())
155 X = RHS.X;
157 switchToLarge(new BitVector(*RHS.getPointer()));
160 SmallBitVector(SmallBitVector &&RHS) : X(RHS.X) {
161 RHS.X = 1;
473 bool anyCommon(const SmallBitVector &RHS) const {
474 if (isSmall() && RHS.isSmall())
475 return (getSmallBits() & RHS.getSmallBits()) != 0;
476 if (!isSmall() && !RHS.isSmall())
477 return getPointer()->anyCommon(*RHS.getPointer());
479 for (unsigned i = 0, e = std::min(size(), RHS.size()); i != e; ++i)
480 if (test(i) && RHS.test(i))
486 bool operator==(const SmallBitVector &RHS) const {
487 if (size() != RHS.size())
489 if (isSmall() && RHS.isSmall())
490 return getSmallBits() == RHS.getSmallBits();
491 else if (!isSmall() && !RHS.isSmall())
492 return *getPointer() == *RHS.getPointer();
495 if ((*this)[i] != RHS[i])
502 bool operator!=(const SmallBitVector &RHS) const {
503 return !(*this == RHS);
508 SmallBitVector &operator&=(const SmallBitVector &RHS) {
509 resize(std::max(size(), RHS.size()));
510 if (isSmall() && RHS.isSmall())
511 setSmallBits(getSmallBits() & RHS.getSmallBits());
512 else if (!isSmall() && !RHS.isSmall())
513 getPointer()->operator&=(*RHS.getPointer());
516 for (i = 0, e = std::min(size(), RHS.size()); i != e; ++i)
517 (*this)[i] = test(i) && RHS.test(i);
524 /// Reset bits that are set in RHS. Same as *this &= ~RHS.
525 SmallBitVector &reset(const SmallBitVector &RHS) {
526 if (isSmall() && RHS.isSmall())
527 setSmallBits(getSmallBits() & ~RHS.getSmallBits());
528 else if (!isSmall() && !RHS.isSmall())
529 getPointer()->reset(*RHS.getPointer());
531 for (unsigned i = 0, e = std::min(size(), RHS.size()); i != e; ++i)
532 if (RHS.test(i))
538 /// Check if (This - RHS) is zero. This is the same as reset(RHS) and any().
539 bool test(const SmallBitVector &RHS) const {
540 if (isSmall() && RHS.isSmall())
541 return (getSmallBits() & ~RHS.getSmallBits()) != 0;
542 if (!isSmall() && !RHS.isSmall())
543 return getPointer()->test(*RHS.getPointer());
546 for (i = 0, e = std::min(size(), RHS.size()); i != e; ++i)
547 if (test(i) && !RHS.test(i))
557 SmallBitVector &operator|=(const SmallBitVector &RHS) {
558 resize(std::max(size(), RHS.size()));
559 if (isSmall() && RHS.isSmall())
560 setSmallBits(getSmallBits() | RHS.getSmallBits());
561 else if (!isSmall() && !RHS.isSmall())
562 getPointer()->operator|=(*RHS.getPointer());
564 for (size_t i = 0, e = RHS.size(); i != e; ++i)
565 (*this)[i] = test(i) || RHS.test(i);
570 SmallBitVector &operator^=(const SmallBitVector &RHS) {
571 resize(std::max(size(), RHS.size()));
572 if (isSmall() && RHS.isSmall())
573 setSmallBits(getSmallBits() ^ RHS.getSmallBits());
574 else if (!isSmall() && !RHS.isSmall())
575 getPointer()->operator^=(*RHS.getPointer());
577 for (size_t i = 0, e = RHS.size(); i != e; ++i)
578 (*this)[i] = test(i) != RHS.test(i);
600 const SmallBitVector &operator=(const SmallBitVector &RHS) {
602 if (RHS.isSmall())
603 X = RHS.X;
605 switchToLarge(new BitVector(*RHS.getPointer()));
607 if (!RHS.isSmall())
608 *getPointer() = *RHS.getPointer();
611 X = RHS.X;
617 const SmallBitVector &operator=(SmallBitVector &&RHS) {
618 if (this != &RHS) {
620 swap(RHS);
625 void swap(SmallBitVector &RHS) {
626 std::swap(X, RHS.X);
682 operator&(const SmallBitVector &LHS, const SmallBitVector &RHS) {
684 Result &= RHS;
689 operator|(const SmallBitVector &LHS, const SmallBitVector &RHS) {
691 Result |= RHS;
696 operator^(const SmallBitVector &LHS, const SmallBitVector &RHS) {
698 Result ^= RHS;
708 swap(llvm::SmallBitVector &LHS, llvm::SmallBitVector &RHS) {
709 LHS.swap(RHS);