diff options
author | Justin Lebar <jlebar@google.com> | 2016-12-29 19:59:26 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-12-29 19:59:26 +0000 |
commit | 175ab74dc52f52e9d14d31d4fbf8a1e2d0995017 (patch) | |
tree | 18bff7f7252b972aa52e7e79c3fa6746eb3f69eb /llvm/lib/Support | |
parent | 291264b612415dc3462ace9aab8c713cc81de7c8 (diff) | |
download | bcm5719-llvm-175ab74dc52f52e9d14d31d4fbf8a1e2d0995017.tar.gz bcm5719-llvm-175ab74dc52f52e9d14d31d4fbf8a1e2d0995017.zip |
[ADT] Delete RefCountedBaseVPTR.
Summary:
This class is unnecessary.
Its comment indicated that it was a compile error to allocate an
instance of a class that inherits from RefCountedBaseVPTR on the stack.
This may have been true at one point, but it's not today.
Moreover you really do not want to allocate *any* refcounted object on
the stack, vptrs or not, so if we did have a way to prevent these
objects from being stack-allocated, we'd want to apply it to regular
RefCountedBase too, obviating the need for a separate RefCountedBaseVPTR
class.
It seems that the main way RefCountedBaseVPTR provides safety is by
making its subclass's destructor virtual. This may have been helpful at
one point, but these days clang will emit an error if you define a class
with virtual functions that inherits from RefCountedBase but doesn't
have a virtual destructor.
Reviewers: compnerd, dblaikie
Subscribers: cfe-commits, klimek, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D28162
llvm-svn: 290717
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/CMakeLists.txt | 1 | ||||
-rw-r--r-- | llvm/lib/Support/IntrusiveRefCntPtr.cpp | 14 |
2 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 03addcbcd16..ca344b1dc05 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -61,7 +61,6 @@ add_llvm_library(LLVMSupport Hashing.cpp IntEqClasses.cpp IntervalMap.cpp - IntrusiveRefCntPtr.cpp JamCRC.cpp LEB128.cpp LineIterator.cpp diff --git a/llvm/lib/Support/IntrusiveRefCntPtr.cpp b/llvm/lib/Support/IntrusiveRefCntPtr.cpp deleted file mode 100644 index a8b45593ae7..00000000000 --- a/llvm/lib/Support/IntrusiveRefCntPtr.cpp +++ /dev/null @@ -1,14 +0,0 @@ -//== IntrusiveRefCntPtr.cpp - Smart Refcounting Pointer ----------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/ADT/IntrusiveRefCntPtr.h" - -using namespace llvm; - -void RefCountedBaseVPTR::anchor() { } |