]> granicus.if.org Git - clang/commit
[ADT] Delete RefCountedBaseVPTR.
authorJustin Lebar <jlebar@google.com>
Thu, 29 Dec 2016 19:59:26 +0000 (19:59 +0000)
committerJustin Lebar <jlebar@google.com>
Thu, 29 Dec 2016 19:59:26 +0000 (19:59 +0000)
commita7c050e2d7075d551e72d78286a5f05083dc64b0
treebac3ddf8c89dfb10f3906e7438bda0a08785a0d3
parent715c2ef7122c091bc6f5899a6120deb5390a6fac
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290717 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/ASTMatchers/Dynamic/VariantValue.h
include/clang/Basic/LLVM.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h