#ifndef LLVM_ADT_INTRUSIVE_REF_CNT_PTR
#define LLVM_ADT_INTRUSIVE_REF_CNT_PTR
-#include <cassert>
-
#include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
namespace llvm {
retain();
}
+#if LLVM_USE_RVALUE_REFERENCES
+ IntrusiveRefCntPtr(IntrusiveRefCntPtr&& S) : Obj(S.Obj) {
+ S.Obj = 0;
+ }
+
+ template <class X>
+ IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.getPtr()) {
+ S.Obj = 0;
+ }
+#endif
+
template <class X>
IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
: Obj(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());