[libcxxabi] r228436 - Unwind: hoist placement delete into base class

Saleem Abdulrasool compnerd at compnerd.org
Fri Feb 6 12:34:17 PST 2015


Author: compnerd
Date: Fri Feb  6 14:34:17 2015
New Revision: 228436

URL: http://llvm.org/viewvc/llvm-project?rev=228436&view=rev
Log:
Unwind: hoist placement delete into base class

Move the placement delete into the base class.  This permits the proper emission
of the virtual destructor in UnwindCursor by using the class specific placement
delete instead of the normal single element ::operator delete.  With this patch,
we can finally build libunwind as a DSO without a runtime dependency on
libc++/libc++abi.

Modified:
    libcxxabi/trunk/src/Unwind/UnwindCursor.hpp

Modified: libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindCursor.hpp?rev=228436&r1=228435&r2=228436&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindCursor.hpp (original)
+++ libcxxabi/trunk/src/Unwind/UnwindCursor.hpp Fri Feb  6 14:34:17 2015
@@ -368,6 +368,10 @@ private:
 
 class _LIBUNWIND_HIDDEN AbstractUnwindCursor {
 public:
+  // NOTE: provide a class specific placement deallocation function (S5.3.4 p20)
+  // This avoids an unnecessary dependency to libc++abi.
+  void operator delete(void *, size_t) {}
+
   virtual ~AbstractUnwindCursor() {}
   virtual bool validReg(int) { _LIBUNWIND_ABORT("validReg not implemented"); }
   virtual unw_word_t getReg(int) { _LIBUNWIND_ABORT("getReg not implemented"); }
@@ -431,8 +435,6 @@ public:
   virtual void        saveVFPAsX();
 #endif
 
-  void            operator delete(void *, size_t) {}
-
 private:
 
 #if LIBCXXABI_ARM_EHABI





More information about the cfe-commits mailing list