]> granicus.if.org Git - clang/commitdiff
Implement a better fix for r186894 by setting the appropriate type for __byref_variab...
authorAdrian Prantl <aprantl@apple.com>
Tue, 23 Jul 2013 00:12:14 +0000 (00:12 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 23 Jul 2013 00:12:14 +0000 (00:12 +0000)
rdar://problem/14386148

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186898 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 64259b3e99357644bd8cc2ba4a6c52b955b10f47..4de21d2b39776fab1eccc4a1751a5dd83e6e8b32 100644 (file)
@@ -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,