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 | 687cc4a850b59116efee061018f0d8df50728b82 (patch) | |
tree | 96c2493c4ccccbe9ad2c9fb2569b2f02565f332b /lib/CodeGen/CGBlocks.cpp | |
parent | 75345163535eb1765ba8fb971974be895645cb45 (diff) |
Introduce CodeGenModule::GetTargetTypeStoreSize() to calculate the store size
of LLVM types in character units.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 72da7d32eb..15347a488f 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/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(); |