summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-25 15:20:39 +0000
committerDan Gohman <gohman@apple.com>2010-02-25 15:20:39 +0000
commitaa9d854b334cab2f29ca6d95413a0946b8a38429 (patch)
treecea0953c05223188ec4fb31bfc0a915b83c2b5b1 /include
parent9a49f1552db7e2ce24a03ec068b17db8a238856d (diff)
downloadllvm-aa9d854b334cab2f29ca6d95413a0946b8a38429.tar.gz
llvm-aa9d854b334cab2f29ca6d95413a0946b8a38429.tar.bz2
llvm-aa9d854b334cab2f29ca6d95413a0946b8a38429.tar.xz
Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar integer and vector has endian-specific results, which undermines this whole approach. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetData.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index 8c3f896268..cc88dae9fa 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -193,7 +193,9 @@ 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;
+ uint64_t getTypeStoreSize(const Type *Ty) const {
+ return (getTypeSizeInBits(Ty)+7)/8;
+ }
/// getTypeStoreSizeInBits - Return the maximum number of bits that may be
/// overwritten by storing the specified type; always a multiple of 8. For
@@ -206,7 +208,10 @@ 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;
+ uint64_t getTypeAllocSize(const Type* Ty) const {
+ // Round up to the next alignment boundary.
+ return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty));
+ }
/// getTypeAllocSizeInBits - Return the offset in bits between successive
/// objects of the specified type, including alignment padding; always a