Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed...
[oota-llvm.git] / include / llvm / ADT / IntrusiveRefCntPtr.h
index 8804f2b20f77d788eeceea22049a57d3b832ec0a..37d4ac9d29df518abaa753357cf406257502fde1 100644 (file)
@@ -1,4 +1,4 @@
-//== llvm/ADT/IntrusiveRefCntPtr.h - Smart Refcounting Pointer ----*- C++ -*-==//
+//== llvm/ADT/IntrusiveRefCntPtr.h - Smart Refcounting Pointer ---*- C++ -*-==//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -121,6 +121,11 @@ namespace llvm {
       retain();
     }
 
+    IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr& S) {
+      replace(S.getPtr());
+      return *this;
+    }
+
     template <class X>
     IntrusiveRefCntPtr& operator=(const IntrusiveRefCntPtr<X>& S) {
       replace(S.getPtr());
@@ -140,7 +145,7 @@ namespace llvm {
 
     T* getPtr() const { return Obj; }
 
-    typedef T * IntrusiveRefCntPtr::*unspecified_bool_type;
+    typedef T* (IntrusiveRefCntPtr::*unspecified_bool_type) () const;
     operator unspecified_bool_type() const {
       return Obj == 0 ? 0 : &IntrusiveRefCntPtr::getPtr;
     }
@@ -156,7 +161,7 @@ namespace llvm {
     void release() { if (Obj) Obj->Release(); }
 
     void replace(T* S) {
-      this_type(S).swap(this);
+      this_type(S).swap(*this);
     }
   };
 
@@ -222,4 +227,4 @@ namespace llvm {
 
 } // end namespace llvm
 
-#endif // LLVM_ADT_INTRUSIVE_REF_CNT_PTR
\ No newline at end of file
+#endif // LLVM_ADT_INTRUSIVE_REF_CNT_PTR