diff options
author | Mike Stump <mrs@apple.com> | 2009-02-13 17:03:17 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-02-13 17:03:17 +0000 |
commit | 3ba8215d5b14fca14835076f0f40334ecc967121 (patch) | |
tree | 1645d779ce4f4158f6a1712754104572b05268fe /lib/CodeGen/CGBlocks.cpp | |
parent | 56129b1f98e8a40d493476fdb7f57cee63ceb7e7 (diff) |
Calculate size correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 5 |
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) { |