X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FIntrusiveRefCntPtr.h;h=a9724ee15447cb9248b819caa8e4bd005c15588a;hb=6d42bbfe5e18f7256049435f2e23d11aeee670f1;hp=37018d95e604fc5fa6ff3019c9e45c4f57f51887;hpb=5acc40a0373ed183d944b4f165dbb0b6798d5a92;p=oota-llvm.git diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h index 37018d95e60..a9724ee1544 100644 --- a/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -34,7 +34,7 @@ namespace llvm { /// RefCountedBase - A generic base class for objects that wish to /// have their lifetimes managed using reference counts. Classes /// subclass RefCountedBase to obtain such functionality, and are -/// typically handled with IntrusivePtr "smart pointers" (see below) +/// typically handled with IntrusiveRefCntPtr "smart pointers" (see below) /// which automatically handle the management of reference counts. /// Objects that subclass RefCountedBase should not be allocated on /// the stack, as invoking "delete" (which is called when the @@ -140,32 +140,8 @@ namespace llvm { retain(); } - IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr& S) { - replace(S.getPtr()); - return *this; - } - -#if LLVM_USE_RVALUE_REFERENCES - IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) { - this_type(std::move(S)).swap(*this); - return *this; - } - - template - IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) { - this_type(std::move(S)).swap(*this); - return *this; - } -#endif - - template - IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr& S) { - replace(S.getPtr()); - return *this; - } - - IntrusiveRefCntPtr& operator=(T * S) { - replace(S); + IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr S) { + swap(S); return *this; } @@ -200,10 +176,6 @@ namespace llvm { private: void retain() { if (Obj) IntrusiveRefCntPtrInfo::retain(Obj); } void release() { if (Obj) IntrusiveRefCntPtrInfo::release(Obj); } - - void replace(T* S) { - this_type(S).swap(*this); - } }; template