diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-05-20 03:46:04 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-05-20 03:46:04 +0000 |
commit | 16dc7b68c4d90cd3abac7015c27030f3d6c710f9 (patch) | |
tree | 88c7090be664baa4ac9b397a65a20821304d4e8c /clang/test/OpenMP/parallel_default_messages.cpp | |
parent | 1f294fd934c17ec9836cbde8293d3c51974cdb05 (diff) | |
download | bcm5719-llvm-16dc7b68c4d90cd3abac7015c27030f3d6c710f9.tar.gz bcm5719-llvm-16dc7b68c4d90cd3abac7015c27030f3d6c710f9.zip |
Fix for aggregate copying of variable length arrays.
Patch fixes codegen for aggregate copying of VLAs. Currently method CodeGenFunction::EmitAggregateCopy() does not support copying of VLAs. Patch checks if the size of the type is 0, then checks if the type is actually a variable-length array. Then it calculates total length for this array and calculates total size of the array in bytes:
<total number of elements in array> * aligned_sizeof(ElementType) (if copy assignment is requested).
If simple copying is requested, size is calculated like:
<total number of elements in array> * aligned_sizeof(ElementType) - aligned_sizeof(ElementType) + sizeof(ElementType).
memcpy() is used with this calculated size of the VLA.
Differential Revision: http://reviews.llvm.org/D9851
llvm-svn: 237768
Diffstat (limited to 'clang/test/OpenMP/parallel_default_messages.cpp')
0 files changed, 0 insertions, 0 deletions