diff options
| author | Eric Fiselier <eric@efcs.ca> | 2019-06-08 01:31:19 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2019-06-08 01:31:19 +0000 |
| commit | d63dd874ecbdcbc9bdcfc4fde4e372ad2f605ba5 (patch) | |
| tree | f2560935bef45f0387e3d662423c9291d1fe682f /libcxx/include/__config | |
| parent | 3ba09eda0c7970087f8bfe09206e33a665f51298 (diff) | |
| download | bcm5719-llvm-d63dd874ecbdcbc9bdcfc4fde4e372ad2f605ba5.tar.gz bcm5719-llvm-d63dd874ecbdcbc9bdcfc4fde4e372ad2f605ba5.zip | |
Substantially reduce instantiations and debug size of std::function
std::function uses a standard allocator to manage its memory, however
standard allocators are templates and using them correctly requires
a stupid amount of instantiations. This leads to a substantial increase
in debug info and object sizes.
This patch addresses the issue by dropping the allocator when possible
and using raw new and delete to get memory.
This change decreases the object file size for the test func.wrap.func.con/F.pass.cpp by 33% and the final binary by 29% (when compiled with -g -ggnu-pubnames -gpubnames).
It also roughly halfs the number of entries in the pubnames and pubtype
sections.
llvm-svn: 362865
Diffstat (limited to 'libcxx/include/__config')
| -rw-r--r-- | libcxx/include/__config | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index b63102c20d1..6a1e0f57739 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1272,6 +1272,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( # define _LIBCPP_FALLTHROUGH() ((void)0) #endif +#if defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC) +#define _LIBCPP_NODEBUG __attribute__((nodebug)) +#else +#define _LIBCPP_NODEBUG +#endif + #if defined(_LIBCPP_ABI_MICROSOFT) && \ (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) # define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases) |

