1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[ADT] Rename RefCountedBase::ref_cnt to RefCount. NFC

This makes it comply with the LLVM style guide, and also makes it
consistent with ThreadSafeRefCountedBase below.

llvm-svn: 290719
This commit is contained in:
Justin Lebar 2016-12-29 19:59:34 +00:00
parent c54ca36396
commit 61e5b34b7e

View File

@ -38,16 +38,16 @@ namespace llvm {
/// reference count hits 0) on such objects is an error.
//===----------------------------------------------------------------------===//
template <class Derived> class RefCountedBase {
mutable unsigned ref_cnt = 0;
mutable unsigned RefCount = 0;
public:
RefCountedBase() = default;
RefCountedBase(const RefCountedBase &) : ref_cnt(0) {}
RefCountedBase(const RefCountedBase &) : RefCount(0) {}
void Retain() const { ++ref_cnt; }
void Retain() const { ++RefCount; }
void Release() const {
assert(ref_cnt > 0 && "Reference count is already zero.");
if (--ref_cnt == 0)
assert(RefCount > 0 && "Reference count is already zero.");
if (--RefCount == 0)
delete static_cast<const Derived *>(this);
}
};