[llvm] r353329 - build: Remove the cmake check for malloc.h.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 6 11:20:47 PST 2019
Author: pcc
Date: Wed Feb 6 11:20:47 2019
New Revision: 353329
URL: http://llvm.org/viewvc/llvm-project?rev=353329&view=rev
Log:
build: Remove the cmake check for malloc.h.
As far as I can tell, malloc.h is only being used here to provide
a definition of mallinfo (malloc itself is declared in stdlib.h via
cstdlib). We already have a macro for whether mallinfo is available,
so switch to using that instead.
Differential Revision: https://reviews.llvm.org/D57807
Modified:
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/include/llvm/Config/config.h.cmake
llvm/trunk/lib/Support/Unix/Process.inc
llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=353329&r1=353328&r2=353329&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Wed Feb 6 11:20:47 2019
@@ -28,7 +28,6 @@ check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(errno.h HAVE_ERRNO_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(link.h HAVE_LINK_H)
-check_include_file(malloc.h HAVE_MALLOC_H)
check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H)
if( NOT PURE_WINDOWS )
check_include_file(pthread.h HAVE_PTHREAD_H)
Modified: llvm/trunk/include/llvm/Config/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.cmake?rev=353329&r1=353328&r2=353329&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake (original)
+++ llvm/trunk/include/llvm/Config/config.h.cmake Wed Feb 6 11:20:47 2019
@@ -127,9 +127,6 @@
/* Define to 1 if you have the `mallinfo' function. */
#cmakedefine HAVE_MALLINFO ${HAVE_MALLINFO}
-/* Define to 1 if you have the <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H}
-
/* Define to 1 if you have the <malloc/malloc.h> header file. */
#cmakedefine HAVE_MALLOC_MALLOC_H ${HAVE_MALLOC_MALLOC_H}
Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=353329&r1=353328&r2=353329&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Wed Feb 6 11:20:47 2019
@@ -32,10 +32,7 @@
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
-// DragonFlyBSD, and OpenBSD have deprecated <malloc.h> for
-// <stdlib.h> instead. Unix.h includes this for us already.
-#if defined(HAVE_MALLOC_H) && !defined(__DragonFly__) && \
- !defined(__OpenBSD__)
+#if defined(HAVE_MALLINFO)
#include <malloc.h>
#endif
#if defined(HAVE_MALLCTL)
Modified: llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn?rev=353329&r1=353328&r2=353329&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn Wed Feb 6 11:20:47 2019
@@ -159,7 +159,6 @@ write_cmake_config("config") {
"HAVE_CRASHREPORTER_INFO=1",
"HAVE_DECL_ARC4RANDOM=1",
"HAVE_DLADDR=1",
- "HAVE_MALLOC_H=",
"HAVE_MACH_MACH_H=1",
"HAVE_MALLOC_MALLOC_H=1",
"HAVE_MALLOC_ZONE_STATISTICS=1",
@@ -171,7 +170,6 @@ write_cmake_config("config") {
"HAVE_DECL_ARC4RANDOM=",
"HAVE_DLADDR=",
"HAVE_MACH_MACH_H=",
- "HAVE_MALLOC_H=1",
"HAVE_MALLOC_MALLOC_H=",
"HAVE_MALLOC_ZONE_STATISTICS=",
"HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC=",
More information about the llvm-commits
mailing list