summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-02-13 17:03:17 +0000
committerMike Stump <mrs@apple.com>2009-02-13 17:03:17 +0000
commit52197c77630e01e69aef176517f4ee89c9bd2bbe (patch)
treecb4f8b6a4b332e6e2d60fd2c0c964df321b3bdf4 /clang/lib
parentc2c38331ca57c1af3c7ea88bd0c9db12f06e2a27 (diff)
downloadbcm5719-llvm-52197c77630e01e69aef176517f4ee89c9bd2bbe.tar.gz
bcm5719-llvm-52197c77630e01e69aef176517f4ee89c9bd2bbe.zip
Calculate size correctly.
llvm-svn: 64459
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