summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index f987af70d32..a7f5aacde72 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud