From 5a364c5561ec04e33a6f5d52c14f1bac6f247ea0 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Fri, 15 Nov 2013 22:34:48 +0000 Subject: [weak vtables] Remove a bunch of weak vtables This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/AttributeImpl.h | 2 -- lib/IR/Attributes.cpp | 2 -- lib/IR/Metadata.cpp | 4 +++- lib/IR/Value.cpp | 8 ++------ 4 files changed, 5 insertions(+), 11 deletions(-) (limited to 'lib/IR') diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 9da3f96..2d26044 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -46,8 +46,6 @@ protected: AttributeImpl(AttrEntryKind KindID) : KindID(KindID) {} public: - virtual ~AttributeImpl(); - bool isEnumAttribute() const { return KindID == EnumAttrEntry; } bool isAlignAttribute() const { return KindID == AlignAttrEntry; } bool isStringAttribute() const { return KindID == StringAttrEntry; } diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index bcd324c..f876778 100644 --- a/lib/IR/Attributes.cpp +++ b/lib/IR/Attributes.cpp @@ -286,8 +286,6 @@ bool Attribute::operator<(Attribute A) const { // AttributeImpl Definition //===----------------------------------------------------------------------===// -AttributeImpl::~AttributeImpl() {} - bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { if (isStringAttribute()) return false; return getKindAsEnum() == A; diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index bd4d9c0..ef0660d 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -65,7 +65,7 @@ class MDNodeOperand : public CallbackVH { public: MDNodeOperand(Value *V) : CallbackVH(V) {} - ~MDNodeOperand() {} + virtual ~MDNodeOperand(); void set(Value *V) { unsigned IsFirst = this->getValPtrInt(); @@ -82,6 +82,8 @@ public: }; } // end namespace llvm. +MDNodeOperand::~MDNodeOperand() {} + void MDNodeOperand::deleted() { getParent()->replaceOperand(this, 0); diff --git a/lib/IR/Value.cpp b/lib/IR/Value.cpp index 35808a6..a56272f 100644 --- a/lib/IR/Value.cpp +++ b/lib/IR/Value.cpp @@ -735,9 +735,5 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) { #endif } -// Default implementation for CallbackVH. -void CallbackVH::allUsesReplacedWith(Value *) {} - -void CallbackVH::deleted() { - setValPtr(NULL); -} +// pin vtable to this file +void CallbackVH::anchor() {} -- cgit v1.1