SmallVector: Crank up verbosity of asserts per Chandler's request.
[oota-llvm.git] / include / llvm / ADT / IntrusiveRefCntPtr.h
index 947ccc46a5236b75d701f0b2ccd5e5ec0697c0bf..0c02a8f318543b651ddb1076733245a9c5cdb015 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Compiler.h"
+#include <memory>
 
 namespace llvm {
 
@@ -139,34 +140,8 @@ namespace llvm {
       retain();
     }
 
-    IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr& S) {
-      replace(S.getPtr());
-      return *this;
-    }
-
-#if LLVM_USE_RVALUE_REFERENCES
-    IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr&& S) {
-      Obj = S.Obj;
-      S.Obj = 0;
-      return *this;
-    }
-
-    template <class X>
-    IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr<X>&& S) {
-      Obj = S.getPtr();
-      S.Obj = 0;
-      return *this;
-    }
-#endif
-
-    template <class X>
-    IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr<X>& S) {
-      replace(S.getPtr());
-      return *this;
-    }
-
-    IntrusiveRefCntPtr& operator=(T * S) {
-      replace(S);
+    IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr S) {
+      swap(S);
       return *this;
     }
 
@@ -201,10 +176,6 @@ namespace llvm {
   private:
     void retain() { if (Obj) IntrusiveRefCntPtrInfo<T>::retain(Obj); }
     void release() { if (Obj) IntrusiveRefCntPtrInfo<T>::release(Obj); }
-
-    void replace(T* S) {
-      this_type(S).swap(*this);
-    }
   };
 
   template<class T, class U>