[constexpr] Support for constant evaluation of __builtin_memcpy and
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 31 Jul 2018 23:35:09 +0000 (23:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 31 Jul 2018 23:35:09 +0000 (23:35 +0000)
commit96beffba15bce42e086fde5569a67c5bbf4243ee
treec8bb41985ed79f9d8d115c9a7d5d4c94e7f3127f
parent5802ab265cd36c0f75cbe906c3f2ca5addc9e48d
[constexpr] Support for constant evaluation of __builtin_memcpy and
__builtin_memmove (in non-type-punning cases).

This is intended to permit libc++ to make std::copy etc constexpr
without sacrificing the optimization that uses memcpy on
trivially-copyable types.

__builtin_strcpy and __builtin_wcscpy are not handled by this change.
They'd be straightforward to add, but we haven't encountered a need for
them just yet.

llvm-svn: 338455
clang/include/clang/Basic/Builtins.def
clang/include/clang/Basic/DiagnosticASTKinds.td
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGen/builtin-memfns.c
clang/test/SemaCXX/constexpr-string.cpp