LLVM 20.0.0git
|
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes. More...
#include <atomic>
#include <cassert>
#include <cstddef>
#include <memory>
Go to the source code of this file.
Classes | |
class | llvm::RefCountedBase< Derived > |
A CRTP mixin class that adds reference counting to a type. More... | |
class | llvm::ThreadSafeRefCountedBase< Derived > |
A thread-safe version of RefCountedBase . More... | |
struct | llvm::IntrusiveRefCntPtrInfo< T > |
Class you can specialize to provide custom retain/release functionality for a type. More... | |
class | llvm::IntrusiveRefCntPtr< T > |
A smart pointer to a reference-counted object that inherits from RefCountedBase or ThreadSafeRefCountedBase. More... | |
struct | llvm::simplify_type< IntrusiveRefCntPtr< T > > |
struct | llvm::simplify_type< const IntrusiveRefCntPtr< T > > |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Functions | |
template<class T , class U > | |
bool | llvm::operator== (const IntrusiveRefCntPtr< T > &A, const IntrusiveRefCntPtr< U > &B) |
template<class T , class U > | |
bool | llvm::operator!= (const IntrusiveRefCntPtr< T > &A, const IntrusiveRefCntPtr< U > &B) |
template<class T , class U > | |
bool | llvm::operator== (const IntrusiveRefCntPtr< T > &A, U *B) |
template<class T , class U > | |
bool | llvm::operator!= (const IntrusiveRefCntPtr< T > &A, U *B) |
template<class T , class U > | |
bool | llvm::operator== (T *A, const IntrusiveRefCntPtr< U > &B) |
template<class T , class U > | |
bool | llvm::operator!= (T *A, const IntrusiveRefCntPtr< U > &B) |
template<class T > | |
bool | llvm::operator== (std::nullptr_t, const IntrusiveRefCntPtr< T > &B) |
template<class T > | |
bool | llvm::operator== (const IntrusiveRefCntPtr< T > &A, std::nullptr_t B) |
template<class T > | |
bool | llvm::operator!= (std::nullptr_t A, const IntrusiveRefCntPtr< T > &B) |
template<class T > | |
bool | llvm::operator!= (const IntrusiveRefCntPtr< T > &A, std::nullptr_t B) |
template<typename T , typename... Args> | |
IntrusiveRefCntPtr< T > | llvm::makeIntrusiveRefCnt (Args &&...A) |
Factory function for creating intrusive ref counted pointers. | |
This file defines the RefCountedBase, ThreadSafeRefCountedBase, and IntrusiveRefCntPtr classes.
IntrusiveRefCntPtr is a smart pointer to an object which maintains a reference count. (ThreadSafe)RefCountedBase is a mixin class that adds a refcount member variable and methods for updating the refcount. An object that inherits from (ThreadSafe)RefCountedBase deletes itself when its refcount hits zero.
For example:
You can use IntrusiveRefCntPtr with isa<T>(), dyn_cast<T>(), etc.:
IntrusiveRefCntPtr works with any class that
Definition in file IntrusiveRefCntPtr.h.