diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 13:48:07 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 13:48:07 +0000 |
commit | 98ca79435a2829b7486a316ad7b12a087472e87d (patch) | |
tree | 9fdca667bed17f35e0a0d0e4c4bdf003faa042db /clang/lib/CodeGen/CGBlocks.cpp | |
parent | de018dcfad6adda3687effec3d9ea86f246e4a14 (diff) | |
download | bcm5719-llvm-98ca79435a2829b7486a316ad7b12a087472e87d.tar.gz bcm5719-llvm-98ca79435a2829b7486a316ad7b12a087472e87d.zip |
Introduce CodeGenModule::GetTargetTypeStoreSize() to calculate the store size
of LLVM types in character units.
llvm-svn: 94542
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 72da7d32eb1..15347a488fa 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -593,8 +593,8 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) { // Block literal size. For global blocks we just use the size of the generic // block literal struct. - CharUnits BlockLiteralSize = CharUnits::fromQuantity( - TheTargetData.getTypeStoreSizeInBits(getGenericBlockLiteralType()) / 8); + CharUnits BlockLiteralSize = + CGM.GetTargetTypeStoreSize(getGenericBlockLiteralType()); DescriptorFields[1] = llvm::ConstantInt::get(UnsignedLongTy,BlockLiteralSize.getQuantity()); @@ -698,9 +698,8 @@ CodeGenFunction::GenerateBlockFunction(const BlockExpr *BExpr, LocalDeclMap[VD] = i->second; } - BlockOffset = CharUnits::fromQuantity( - CGM.getTargetData() - .getTypeStoreSizeInBits(CGM.getGenericBlockLiteralType()) / 8); + BlockOffset = + CGM.GetTargetTypeStoreSize(CGM.getGenericBlockLiteralType()); BlockAlign = getContext().getTypeAlign(getContext().VoidPtrTy) / 8; const FunctionType *BlockFunctionType = BExpr->getFunctionType(); |