diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-24 22:05:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-24 22:05:23 +0000 |
commit | c382bc3c0f476bf94303d9892af4e2cee173bfe5 (patch) | |
tree | 177ed972f2efd65c0f0296b1899e97042128a4cb /include | |
parent | 46ca5efdd5b748ba8aa62168f7753cb46b683bc5 (diff) | |
download | external_llvm-c382bc3c0f476bf94303d9892af4e2cee173bfe5.zip external_llvm-c382bc3c0f476bf94303d9892af4e2cee173bfe5.tar.gz external_llvm-c382bc3c0f476bf94303d9892af4e2cee173bfe5.tar.bz2 |
Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.
Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.
Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.
This fixes PR1784.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetData.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index cc88dae..8c3f896 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -193,9 +193,7 @@ public: /// getTypeStoreSize - Return the maximum number of bytes that may be /// overwritten by storing the specified type. For example, returns 5 /// for i36 and 10 for x86_fp80. - uint64_t getTypeStoreSize(const Type *Ty) const { - return (getTypeSizeInBits(Ty)+7)/8; - } + uint64_t getTypeStoreSize(const Type *Ty) const; /// getTypeStoreSizeInBits - Return the maximum number of bits that may be /// overwritten by storing the specified type; always a multiple of 8. For @@ -208,10 +206,7 @@ public: /// of the specified type, including alignment padding. This is the amount /// that alloca reserves for this type. For example, returns 12 or 16 for /// x86_fp80, depending on alignment. - uint64_t getTypeAllocSize(const Type* Ty) const { - // Round up to the next alignment boundary. - return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty)); - } + uint64_t getTypeAllocSize(const Type* Ty) const; /// getTypeAllocSizeInBits - Return the offset in bits between successive /// objects of the specified type, including alignment padding; always a |