[libcxx-commits] [PATCH] D57262: [libunwind] Drop the dependency on <algorithm>, add placement new inline

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 25 15:32:34 PST 2019


phosek created this revision.
phosek added reviewers: ldionne, EricWF, mstorsjo.
Herald added subscribers: libcxx-commits, dexonsmith, christof, mehdi_amini.

We haven't eliminated C++ library dependency altogether in D57251 <https://reviews.llvm.org/D57251>,
UnwindCursor.hpp had an unused dependency on <algorithm> which was
pulling in other C++ headers. Removing that dependency also revealed
(correctly) that we need our own placement new inline definition.

Now libunwind should be really independent of C++ library.


Repository:
  rUNW libunwind

https://reviews.llvm.org/D57262

Files:
  libunwind/src/UnwindCursor.hpp
  libunwind/src/libunwind.cpp


Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -27,6 +27,8 @@
 
 using namespace libunwind;
 
+inline void* operator new(size_t, void* __p) { return __p; }
+
 /// internal object to represent this processes address space
 LocalAddressSpace LocalAddressSpace::sThisAddressSpace;
 
Index: libunwind/src/UnwindCursor.hpp
===================================================================
--- libunwind/src/UnwindCursor.hpp
+++ libunwind/src/UnwindCursor.hpp
@@ -11,7 +11,6 @@
 #ifndef __UNWINDCURSOR_HPP__
 #define __UNWINDCURSOR_HPP__
 
-#include <algorithm>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57262.183637.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190125/2ff27391/attachment.bin>


More information about the libcxx-commits mailing list