From 3ac4ec55dfbdf75e1eac38fb45849130f8c08977 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Thu, 29 Dec 2016 19:59:34 +0000 Subject: [PATCH] [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 --- include/llvm/ADT/IntrusiveRefCntPtr.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h index 66e5af76df4..770f76d5014 100644 --- a/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -38,16 +38,16 @@ namespace llvm { /// reference count hits 0) on such objects is an error. //===----------------------------------------------------------------------===// template 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(this); } };