summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-07-23 00:12:14 +0000
committerAdrian Prantl <aprantl@apple.com>2013-07-23 00:12:14 +0000
commitead2ba4649e68575a886894aeca761524f78aaf3 (patch)
treed672c1b638f5f8dc181724c5141c1705fcdd6efb /clang/lib/CodeGen/CGDebugInfo.cpp
parentc638f0cd4fd47cf54236c11725e312e533c06a7c (diff)
downloadbcm5719-llvm-ead2ba4649e68575a886894aeca761524f78aaf3.tar.gz
bcm5719-llvm-ead2ba4649e68575a886894aeca761524f78aaf3.zip
Implement a better fix for r186894 by setting the appropriate type for __byref_variable_layout.
rdar://problem/14386148 llvm-svn: 186898
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 64259b3e993..4de21d2b397 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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,
OpenPOWER on IntegriCloud