mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 07:39:11 +08:00
Implement a better fix for r186894 by setting the appropriate type for __byref_variable_layout.
rdar://problem/14386148 llvm-svn: 186898
This commit is contained in:
@@ -2599,10 +2599,12 @@ llvm::DIType CGDebugInfo::EmitTypeForVarWithBlocksAttr(const VarDecl *VD,
|
||||
Qualifiers::ObjCLifetime Lifetime;
|
||||
if (CGM.getContext().getByrefLifetime(Type,
|
||||
Lifetime, HasByrefExtendedLayout)
|
||||
&& HasByrefExtendedLayout)
|
||||
&& HasByrefExtendedLayout) {
|
||||
FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
|
||||
EltTys.push_back(CreateMemberType(Unit, FType,
|
||||
"__byref_variable_layout",
|
||||
&FieldOffset));
|
||||
}
|
||||
|
||||
CharUnits Align = CGM.getContext().getDeclAlign(VD);
|
||||
if (Align > CGM.getContext().toCharUnitsFromBits(
|
||||
@@ -2626,7 +2628,6 @@ llvm::DIType CGDebugInfo::EmitTypeForVarWithBlocksAttr(const VarDecl *VD,
|
||||
llvm::DIType FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
|
||||
FieldSize = CGM.getContext().getTypeSize(FType);
|
||||
FieldAlign = CGM.getContext().toBits(Align);
|
||||
FieldOffset += FieldOffset % FieldAlign;
|
||||
|
||||
*XOffset = FieldOffset;
|
||||
FieldTy = DBuilder.createMemberType(Unit, VD->getName(), Unit,
|
||||
|
||||
Reference in New Issue
Block a user