[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 16:27:13 PST 2019
phosek updated this revision to Diff 183655.
phosek marked 2 inline comments as done.
Repository:
rUNW libunwind
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57262/new/
https://reviews.llvm.org/D57262
Files:
libunwind/CMakeLists.txt
libunwind/src/UnwindCursor.hpp
libunwind/src/libunwind.cpp
Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -11,10 +11,6 @@
#include <libunwind.h>
-#ifndef NDEBUG
-#include <cstdlib> // getenv
-#endif
-
#include "libunwind_ext.h"
#include "config.h"
@@ -27,6 +23,10 @@
using namespace libunwind;
+// libunwind does not and should not dependent on C++ library which means that
+// we need our own declaration of global placement new.
+void *operator new(size_t, void*);
+
/// 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>
Index: libunwind/CMakeLists.txt
===================================================================
--- libunwind/CMakeLists.txt
+++ libunwind/CMakeLists.txt
@@ -287,6 +287,9 @@
unwind_append_if(LIBUNWIND_C_FLAGS LIBUNWIND_HAS_FUNWIND_TABLES -funwind-tables)
+# Ensure that we don't depend on C++ standard library.
+unwind_append_if(LIBUNWIND_CXX_FLAGS LIBUNWIND_HAS_NOSTDINCXX_FLAG -nostdinc++)
+
# Assert
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if (LIBUNWIND_ENABLE_ASSERTIONS)
@@ -341,28 +344,6 @@
include_directories(include)
-find_path(
- LIBUNWIND_LIBCXX_INCLUDES_INTERNAL
- __libcpp_version
- PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
- ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx/include
- ${LLVM_MAIN_SRC_DIR}/../libcxx/include
- NO_DEFAULT_PATH
- NO_CMAKE_FIND_ROOT_PATH
- )
-if ((NOT LIBUNWIND_STANDALONE_BUILD OR HAVE_LIBCXX) AND
- IS_DIRECTORY "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
- set(LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT "${LIBUNWIND_LIBCXX_INCLUDES_INTERNAL}")
-endif()
-
-set(LIBUNWIND_CXX_INCLUDE_PATHS "${LIBUNWIND_CXX_INCLUDE_PATHS_DEFAULT}" CACHE PATH
- "Paths to C++ header directories separated by ';'.")
-
-if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STREQUAL "")
- list(APPEND LIBUNWIND_CXX_FLAGS -nostdinc++)
- include_directories("${LIBUNWIND_CXX_INCLUDE_PATHS}")
-endif()
-
add_subdirectory(src)
if (LIBUNWIND_INCLUDE_DOCS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57262.183655.patch
Type: text/x-patch
Size: 2430 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190126/d5c0961d/attachment-0001.bin>
More information about the libcxx-commits
mailing list