hanchenye-llvm-project/libcxx/include
Louis Dionne 53ac1776f3 [libc++] Enable aligned allocation based on feature test macro, irrespective of standard
Summary:
The current code enables aligned allocation functions when compiling in C++17
and later. This is a problem because aligned allocation functions might not
be supported on the target platform, which leads to an error at link time.

Since r338934, Clang knows not to define __cpp_aligned_new when it's not
available on the target platform -- this commit takes advantage of that to
only use aligned allocation functions when they are available.

Reviewers: vsapsai, EricWF

Subscribers: christof, dexonsmith, cfe-commits, EricWF, mclow.lists

Differential Revision: https://reviews.llvm.org/D50344

llvm-svn: 339431
2018-08-10 13:24:56 +00:00
..
experimental Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to." 2018-07-30 22:27:38 +00:00
ext Remove usages of _LIBCPP_MSVC which is never defined 2017-05-10 21:40:58 +00:00
support [libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4 2018-07-27 20:02:58 +00:00
CMakeLists.txt [libc++][C++17] Elementary string conversions for integral types 2018-08-01 02:38:30 +00:00
__bit_reference [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__bsd_locale_defaults.h Add system header pragma to BSD locale fallback headers. 2017-08-03 02:50:43 +00:00
__bsd_locale_fallbacks.h [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
__config [libc++] Enable aligned allocation based on feature test macro, irrespective of standard 2018-08-10 13:24:56 +00:00
__config_site.in [cmake] Add a config option LIBCXX_HAS_WIN32_THREAD_API for enforcing win32 threads 2018-01-05 20:48:29 +00:00
__debug
__errc [libc++] Lift std::errc into a separated header 2018-07-03 03:25:10 +00:00
__functional_03 [libcxx] func.wrap.func.con: Unset function before destroying anything 2018-04-25 23:38:41 +00:00
__functional_base [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
__functional_base_03
__hash_table First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
__libcpp_version Update version to 8.0.0svn: cmake, includes files and docs 2018-08-01 13:54:28 +00:00
__locale [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
__mutex_base [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
__node_handle First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
__nullptr [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
__split_buffer [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__sso_allocator Fix PR22634 - std::allocator doesn't respect over-aligned types. 2018-03-22 04:42:56 +00:00
__std_stream [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__string Fix misleading indentation; replace a couple of NULLs with nullptr. Resolves https://reviews.llvm.org/D42945 ; thanks to Bruce Mitchener for the patch. 2018-02-06 18:58:05 +00:00
__threading_support libcxx: Unbreak external thread library configuration. 2018-02-21 21:36:18 +00:00
__tree [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
__tuple Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility 2017-04-19 01:23:39 +00:00
__undef_macros [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
algorithm Mark __equal_to 's operations as constexpr. 2018-07-14 04:15:19 +00:00
any [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
array Implement P1023: constexpr comparison operators for std::array 2018-08-02 02:11:06 +00:00
atomic Mark __c11_atomic_load as const 2018-06-01 18:02:53 +00:00
bitset [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
cassert
ccomplex
cctype
cerrno
cfenv
cfloat Test for the presence of a bunch of new macros for c++17. These macros come from C11. Part of P0063 2018-07-31 23:29:06 +00:00
charconv [libc++][C++17] Elementary string conversions for integral types 2018-08-01 02:38:30 +00:00
chrono [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
cinttypes
ciso646
climits
clocale
cmath [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
codecvt [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
compare [libc++] Declare <compare> operators with the proper visibility attribute 2018-07-10 13:21:03 +00:00
complex [libcxx] Improve accuracy of complex asinh and acosh 2018-02-19 15:41:36 +00:00
complex.h
condition_variable
csetjmp
csignal
cstdarg
cstdbool
cstddef [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
cstdint
cstdio
cstdlib
cstring
ctgmath
ctime import timespec and timespec_get into namespace std if we're under c++17 or later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet. 2018-07-31 19:25:00 +00:00
ctype.h [libc++] Refactor Windows support headers. 2017-05-10 20:57:45 +00:00
cwchar
cwctype
deque Implement deduction guides for <deque> 2018-05-18 23:44:13 +00:00
errno.h
exception [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
filesystem Implement <filesystem> 2018-07-27 03:07:09 +00:00
float.h Test for the presence of a bunch of new macros for c++17. These macros come from C11. Part of P0063 2018-07-31 23:29:06 +00:00
forward_list Fix PR37694 - std::vector doesn't correctly move construct allocators. 2018-06-05 22:32:52 +00:00
fstream Implement <filesystem> 2018-07-27 03:07:09 +00:00
functional [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
future Fix use of incorrect _LIBCXX macro (should be _LIBCPP). 2018-07-24 09:15:03 +00:00
initializer_list [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
inttypes.h
iomanip
ios [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
iosfwd
iostream
istream [libc++] Factor duplicate code into function templates 2018-07-25 19:40:01 +00:00
iterator Mark one more __wrap_iter operation as constexpr. 2018-07-14 03:06:11 +00:00
limits Fix more unreserved names 2017-06-01 02:29:37 +00:00
limits.h
list Fix PR37694 - std::vector doesn't correctly move construct allocators. 2018-06-05 22:32:52 +00:00
locale [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
locale.h
map First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
math.h [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
memory [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
module.modulemap [libc++][C++17] Elementary string conversions for integral types 2018-08-01 02:38:30 +00:00
mutex Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
new [libc++] Enable aligned allocation based on feature test macro, irrespective of standard 2018-08-10 13:24:56 +00:00
numeric [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
optional Add deduction guides for optional 2018-05-25 02:08:49 +00:00
ostream [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
queue Deduction guides for the container adaptors - queue, stack, and priority_queue 2018-05-22 01:57:53 +00:00
random Change an internal table of constants for the poisson distribution from 2018-01-16 14:54:36 +00:00
ratio Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
regex [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
scoped_allocator More of P0600; marking allocation routines as [[nodiscard]] 2017-11-26 02:55:38 +00:00
set First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
setjmp.h
shared_mutex [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
span [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
sstream [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
stack Deduction guides for the container adaptors - queue, stack, and priority_queue 2018-05-22 01:57:53 +00:00
stdbool.h
stddef.h
stdexcept [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
stdint.h
stdio.h libcxx: Rename vasprintf function to __libcpp_vasprintf. 2018-01-23 18:53:33 +00:00
stdlib.h [libc++] Refactor Windows support headers. 2017-05-10 20:57:45 +00:00
streambuf [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
string Address "always inline function is not always inlinable" warning with GCC. 2018-07-17 05:48:48 +00:00
string.h
string_view Implement LWG3034: P0767R1 breaks previously-standard-layout types 2018-03-21 00:36:05 +00:00
strstream Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 2017-04-18 23:38:41 +00:00
system_error [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
tgmath.h Implement LWG 2835 - fix <tgmath.h> 2018-02-12 19:13:24 +00:00
thread Implement LWG 3039 and 3041 - 'Treating Unnecessary decay'. 2018-03-20 22:37:37 +00:00
tuple Implement P0777: Treating unnecessay decay 2018-02-06 20:56:55 +00:00
type_traits Implement P0887: The identity metafunction 2018-08-02 01:56:02 +00:00
typeindex
typeinfo [NFC][libc++] Consistently use spaces to indent 2018-08-03 22:36:53 +00:00
unordered_map First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
unordered_set First half of C++17's splicing maps and sets 2018-08-01 01:33:38 +00:00
utility [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY 2018-08-01 02:08:59 +00:00
valarray Fix PR22634 - std::allocator doesn't respect over-aligned types. 2018-03-22 04:42:56 +00:00
variant Partially Revert "Workaround GCC bug PR78489 - SFINAE order is not respected." 2018-03-23 23:42:30 +00:00
vector [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY 2018-07-11 23:14:33 +00:00
version Implement P0754R2: The <version> header. 2018-04-03 15:48:24 +00:00
wchar.h [libc++] Account for Microsoft CRT const overloads 2017-09-15 18:49:34 +00:00
wctype.h