summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-23 20:59:10 +0000
committerDan Gohman <gohman@apple.com>2009-09-23 20:59:10 +0000
commit54d4a53c4236df7fcba50698d7c9773081150ee8 (patch)
treeeba30eb5b790d015f4881c78e3e4890458cbe183 /include
parent39523e2cfb625d90aa122252b041e2311a9a8ca5 (diff)
downloadllvm-54d4a53c4236df7fcba50698d7c9773081150ee8.tar.gz
llvm-54d4a53c4236df7fcba50698d7c9773081150ee8.tar.bz2
llvm-54d4a53c4236df7fcba50698d7c9773081150ee8.tar.xz
Add an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 167a70ea10..1f0dd21088 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -552,10 +552,16 @@ namespace llvm {
return getExtendedSizeInBits();
}
+ /// getStoreSize - Return the number of bytes overwritten by a store
+ /// of the specified value type.
+ unsigned getStoreSize() const {
+ return (getSizeInBits() + 7) / 8;
+ }
+
/// getStoreSizeInBits - Return the number of bits overwritten by a store
/// of the specified value type.
unsigned getStoreSizeInBits() const {
- return (getSizeInBits() + 7)/8*8;
+ return getStoreSize() * 8;
}
/// getRoundIntegerType - Rounds the bit-width of the given integer EVT up