[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290719 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Lebar 2016-12-29 19:59:34 +00:00
parent 3fd4af822e
commit 3ac4ec55df

View File

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