r186894 - Debug Info: Acknowledge the alignment when locating byref block variables.
Adrian Prantl
aprantl at apple.com
Mon Jul 22 17:16:47 PDT 2013
On Jul 22, 2013, at 5:07 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Jul 22, 2013 at 4:44 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> Author: adrian
>> Date: Mon Jul 22 18:44:26 2013
>> New Revision: 186894
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=186894&view=rev
>> Log:
>> Debug Info: Acknowledge the alignment when locating byref block variables.
>> Fixes rdar://problem/14386148
>>
>> Added:
>> cfe/trunk/test/CodeGenObjC/block-byref-debuginfo.m
>> Modified:
>> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>
>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=186894&r1=186893&r2=186894&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 22 18:44:26 2013
>> @@ -2626,6 +2626,7 @@ llvm::DIType CGDebugInfo::EmitTypeForVar
>> llvm::DIType FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
>> FieldSize = CGM.getContext().getTypeSize(FType);
>> FieldAlign = CGM.getContext().toBits(Align);
>> + FieldOffset += FieldOffset % FieldAlign;
>
> This math looks very suspicious; I would expect something closer to
> llvm::RoundUpToAlignment().
Fixed even better in r186898.
thanks,
adrian
More information about the cfe-commits
mailing list