HomePhabricator

[constexpr] Support for constant evaluation of __builtin_memcpy and

Description

[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.

This reinstates r338455, reverted in r338602, with a fix to avoid trying
to constant-evaluate a memcpy call if either pointer operand has an
invalid designator.

Details

Committed
rsmithAug 3 2018, 5:57 PM
Parents
rL338940: Fix buildbot breakage.
Branches
Unknown
Tags
Unknown