aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index f987af70d3..a7f5aacde7 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -46,8 +46,9 @@ llvm::Constant *CodeGenFunction::BuildDescriptorBlockDecl() {
Elts.push_back(C);
// Size
- // FIXME: This should be the size of BlockStructType
- C = llvm::ConstantInt::get(UnsignedLongTy, 20);
+ int sz = CGM.getTargetData()
+ .getTypeStoreSizeInBits(CGM.getGenericBlockLiteralType()) / 8;
+ C = llvm::ConstantInt::get(UnsignedLongTy, sz);
Elts.push_back(C);
if (BlockHasCopyDispose) {