From 7cc46527c2452001a0c0e2d1bd912abaf7d45ca4 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 6 Feb 2019 19:20:47 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353329 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/config-ix.cmake | 1 - include/llvm/Config/config.h.cmake | 3 --- lib/Support/Unix/Process.inc | 5 +---- utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 9e9e28f0673..18026d69e87 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -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) diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index a66d0fa070a..53e6c202d13 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -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 header file. */ -#cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H} - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MALLOC_MALLOC_H ${HAVE_MALLOC_MALLOC_H} diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc index 4597ea4fa91..7c834f97114 100644 --- a/lib/Support/Unix/Process.inc +++ b/lib/Support/Unix/Process.inc @@ -32,10 +32,7 @@ #if HAVE_SIGNAL_H #include #endif -// DragonFlyBSD, and OpenBSD have deprecated for -// instead. Unix.h includes this for us already. -#if defined(HAVE_MALLOC_H) && !defined(__DragonFly__) && \ - !defined(__OpenBSD__) +#if defined(HAVE_MALLINFO) #include #endif #if defined(HAVE_MALLCTL) diff --git a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn index 0bf598d0d3d..ebeb6f365d3 100644 --- a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -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=", -- 2.11.0