From d12ccbd3434135bf4dce0d3bd9d0ac1943b20183 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Tue, 19 Nov 2013 00:57:56 +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. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064 --- llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp') diff --git a/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp b/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp index 0c8c4ca16dd..a74e05e7b24 100644 --- a/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp +++ b/llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp @@ -13,9 +13,12 @@ namespace llvm { struct VirtualRefCounted : public RefCountedBaseVPTR { - virtual void f() {} + virtual void f(); }; +// Provide out-of-line definition to prevent weak vtable. +void VirtualRefCounted::f() {} + // Run this test with valgrind to detect memory leaks. TEST(IntrusiveRefCntPtr, RefCountedBaseVPTRCopyDoesNotLeak) { VirtualRefCounted *V1 = new VirtualRefCounted; -- cgit v1.2.3