diff options
| author | Serge Guelton <sguelton@quarkslab.com> | 2019-01-22 13:48:55 +0000 |
|---|---|---|
| committer | Serge Guelton <sguelton@quarkslab.com> | 2019-01-22 13:48:55 +0000 |
| commit | 776f809be3a4d166dc53e7f75acd5bfac4fdbe0f (patch) | |
| tree | 46fe0d552d679b8521ae92fa375ec48a59966e8a /llvm/cmake | |
| parent | 933673d8786a905f77b3366f1a6630ab45f6db20 (diff) | |
| download | bcm5719-llvm-776f809be3a4d166dc53e7f75acd5bfac4fdbe0f.tar.gz bcm5719-llvm-776f809be3a4d166dc53e7f75acd5bfac4fdbe0f.zip | |
Fix llvm::is_trivially_copyable portability issues
llvm::is_trivially_copyable portability is verified at compile time using
std::is_trivially_copyable as the reference implementation.
Unfortunately, the latter is not available on all platforms, so introduce
a proper configure check to detect if it is available on the target platform.
In a similar manner, std::is_copy_assignable is not fully supported for gcc4.9.
Provide a portable (?) implementation instead.
Differential Revision: https://reviews.llvm.org/D57018
llvm-svn: 351820
Diffstat (limited to 'llvm/cmake')
| -rw-r--r-- | llvm/cmake/config-ix.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 30ee2b9cbb6..9e9e28f0673 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -325,6 +325,15 @@ else() unset(HAVE_FFI_CALL CACHE) endif( LLVM_ENABLE_FFI ) +# Whether we can use std::is_trivially_copyable to verify llvm::is_trivially_copyable. +CHECK_CXX_SOURCE_COMPILES(" +#include <type_traits> +struct T { int val; }; +static_assert(std::is_trivially_copyable<T>::value, \"ok\"); +int main() { return 0;} +" HAVE_STD_IS_TRIVIALLY_COPYABLE) + + # Define LLVM_HAS_ATOMICS if gcc or MSVC atomic builtins are supported. include(CheckAtomic) |

