mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Deprecate IntrusiveRefCntPtr::getPtr() in favour of get()
This better aligns with other LLVM-specific and C++ standard library smart pointer types. In particular there are at least a few uses of intrusive refcounting in the frontend where it's worth investigating std::shared_ptr as a more appropriate alternative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212366 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -154,13 +154,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class X>
|
template <class X>
|
||||||
IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.getPtr()) {
|
IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.get()) {
|
||||||
S.Obj = 0;
|
S.Obj = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class X>
|
template <class X>
|
||||||
IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
|
IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
|
||||||
: Obj(S.getPtr()) {
|
: Obj(S.get()) {
|
||||||
retain();
|
retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +175,9 @@ public:
|
|||||||
|
|
||||||
T* operator->() const { return Obj; }
|
T* operator->() const { return Obj; }
|
||||||
|
|
||||||
|
T* get() const { return Obj; }
|
||||||
|
|
||||||
|
/// Deprecated: use get().
|
||||||
T* getPtr() const { return Obj; }
|
T* getPtr() const { return Obj; }
|
||||||
|
|
||||||
LLVM_EXPLICIT operator bool() const { return Obj; }
|
LLVM_EXPLICIT operator bool() const { return Obj; }
|
||||||
@@ -203,42 +206,42 @@ public:
|
|||||||
inline bool operator==(const IntrusiveRefCntPtr<T>& A,
|
inline bool operator==(const IntrusiveRefCntPtr<T>& A,
|
||||||
const IntrusiveRefCntPtr<U>& B)
|
const IntrusiveRefCntPtr<U>& B)
|
||||||
{
|
{
|
||||||
return A.getPtr() == B.getPtr();
|
return A.get() == B.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
|
inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
|
||||||
const IntrusiveRefCntPtr<U>& B)
|
const IntrusiveRefCntPtr<U>& B)
|
||||||
{
|
{
|
||||||
return A.getPtr() != B.getPtr();
|
return A.get() != B.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
inline bool operator==(const IntrusiveRefCntPtr<T>& A,
|
inline bool operator==(const IntrusiveRefCntPtr<T>& A,
|
||||||
U* B)
|
U* B)
|
||||||
{
|
{
|
||||||
return A.getPtr() == B;
|
return A.get() == B;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
|
inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
|
||||||
U* B)
|
U* B)
|
||||||
{
|
{
|
||||||
return A.getPtr() != B;
|
return A.get() != B;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
inline bool operator==(T* A,
|
inline bool operator==(T* A,
|
||||||
const IntrusiveRefCntPtr<U>& B)
|
const IntrusiveRefCntPtr<U>& B)
|
||||||
{
|
{
|
||||||
return A == B.getPtr();
|
return A == B.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U>
|
template<class T, class U>
|
||||||
inline bool operator!=(T* A,
|
inline bool operator!=(T* A,
|
||||||
const IntrusiveRefCntPtr<U>& B)
|
const IntrusiveRefCntPtr<U>& B)
|
||||||
{
|
{
|
||||||
return A != B.getPtr();
|
return A != B.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@@ -268,14 +271,14 @@ public:
|
|||||||
template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
|
template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
|
||||||
typedef T* SimpleType;
|
typedef T* SimpleType;
|
||||||
static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T>& Val) {
|
static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T>& Val) {
|
||||||
return Val.getPtr();
|
return Val.get();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> struct simplify_type<const IntrusiveRefCntPtr<T> > {
|
template<class T> struct simplify_type<const IntrusiveRefCntPtr<T> > {
|
||||||
typedef /*const*/ T* SimpleType;
|
typedef /*const*/ T* SimpleType;
|
||||||
static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
|
static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
|
||||||
return Val.getPtr();
|
return Val.get();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user