diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-31 23:35:09 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-07-31 23:35:09 +0000 |
commit | 0f097ac04fc21e27a382b6b896f52a12e0c02b97 (patch) | |
tree | 28b9d60890f48a5b68bbe3bb5fafd72546339a25 /include/clang/Basic/DiagnosticASTKinds.td | |
parent | 13ac9b27be07334eac62b132de08677fa50b44e1 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticASTKinds.td')
-rw-r--r-- | include/clang/Basic/DiagnosticASTKinds.td | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td index 587254367b..3358fc3d70 100644 --- a/include/clang/Basic/DiagnosticASTKinds.td +++ b/include/clang/Basic/DiagnosticASTKinds.td @@ -163,6 +163,20 @@ def note_constexpr_unsupported_unsized_array : Note< def note_constexpr_unsized_array_indexed : Note< "indexing of array without known bound is not allowed " "in a constant expression">; +def note_constexpr_memcpy_type_pun : Note< + "cannot constant evaluate '%select{memcpy|memmove}0' from object of " + "type %1 to object of type %2">; +def note_constexpr_memcpy_nontrivial : Note< + "cannot constant evaluate '%select{memcpy|memmove}0' between objects of " + "non-trivially-copyable type %1">; +def note_constexpr_memcpy_overlap : Note< + "'%select{memcpy|wmemcpy}0' between overlapping memory regions">; +def note_constexpr_memcpy_unsupported : Note< + "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' " + "not supported: %select{" + "size to copy (%4) is not a multiple of size of element type %3 (%5)|" + "source is not a contiguous array of at least %4 elements of type %3|" + "destination is not a contiguous array of at least %4 elements of type %3}2">; def warn_integer_constant_overflow : Warning< "overflow in expression; result is %0 with type %1">, |