r193661 - Fixing code gen to handle microsoft layouts for which size % alignment
Warren Hunt
whunt at google.com
Tue Oct 29 17:13:04 PDT 2013
Good catch! This actually should have been tested years ago because it's
never worked =)
Activated in revision 193664.
On Tue, Oct 29, 2013 at 4:57 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> On Tue, Oct 29, 2013 at 4:49 PM, Warren Hunt <whunt at google.com> wrote:
>
>> Author: whunt
>> Date: Tue Oct 29 18:49:26 2013
>> New Revision: 193661
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=193661&view=rev
>> Log:
>> Fixing code gen to handle microsoft layouts for which size % alignment
>> != 0
>>
>
> Test case?
>
>
>>
>>
>> Modified:
>> cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
>>
>> Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp?rev=193661&r1=193660&r2=193661&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp Tue Oct 29 18:49:26
>> 2013
>> @@ -203,6 +203,9 @@ public:
>> void CGRecordLayoutBuilder::Layout(const RecordDecl *D) {
>> Alignment = Types.getContext().getASTRecordLayout(D).getAlignment();
>> Packed = D->hasAttr<PackedAttr>();
>> + const ASTRecordLayout &Layout =
>> Types.getContext().getASTRecordLayout(D);
>> + if (Layout.getSize() % Layout.getAlignment() != 0)
>> + Packed = true;
>>
>> if (D->isUnion()) {
>> LayoutUnion(D);
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131029/628401bc/attachment.html>
More information about the cfe-commits
mailing list