-
Alexey Bataev authored
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237768 91177308-0d34-0410-b5e6-96231b3b80d8
Alexey Bataev authoredPatch 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237768 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.