[libcxx-commits] [PATCH] D153272: [libc++] Get rid of _LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 21 06:02:19 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGafc5cca0d401: [libc++] Get rid of _LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153272/new/

https://reviews.llvm.org/D153272

Files:
  libcxx/CMakeLists.txt
  libcxx/src/CMakeLists.txt
  libcxx/src/new.cpp


Index: libcxx/src/new.cpp
===================================================================
--- libcxx/src/new.cpp
+++ libcxx/src/new.cpp
@@ -10,9 +10,7 @@
 #include <cstdlib>
 #include <new>
 
-#if !defined(__GLIBCXX__) &&                                                   \
-    !defined(_LIBCPP_ABI_VCRUNTIME) &&      \
-    !defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
+#if !defined(__GLIBCXX__) && !defined(_LIBCPP_ABI_VCRUNTIME)
 
 // The code below is copied as-is into libc++abi's libcxxabi/src/stdlib_new_delete.cpp
 // file. The version in this file is the canonical one.
@@ -257,4 +255,4 @@
 #endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 // ------------------ END COPY ------------------
 
-#endif // !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
+#endif // !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME
Index: libcxx/src/CMakeLists.txt
===================================================================
--- libcxx/src/CMakeLists.txt
+++ libcxx/src/CMakeLists.txt
@@ -34,7 +34,6 @@
   memory_resource.cpp
   mutex.cpp
   mutex_destructor.cpp
-  new.cpp
   new_handler.cpp
   new_helpers.cpp
   optional.cpp
@@ -133,6 +132,12 @@
   endif()
 endif()
 
+if (LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
+  list(APPEND LIBCXX_SOURCES
+    new.cpp
+    )
+endif()
+
 # Add all the headers to the project for IDEs.
 if (LIBCXX_CONFIGURE_IDE)
   file(GLOB_RECURSE LIBCXX_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*)
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -555,10 +555,6 @@
   # errors.
   target_compile_definitions(${target} PRIVATE -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
 
-  if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
-    target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
-  endif()
-
   if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
     if (LIBCXX_HAS_PTHREAD_LIB)
       target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_PTHREAD_LIB)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153272.533230.patch
Type: text/x-patch
Size: 2038 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230621/5fe2829d/attachment.bin>


More information about the libcxx-commits mailing list