diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-23 20:59:10 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-23 20:59:10 +0000 |
commit | 2366ffd2cb5351918620f34ce997a5a7dc12c788 (patch) | |
tree | 3920e7b57ebe6d07e404c8524c7bd6e28e418ad5 /llvm | |
parent | 75b9c2741dbe0634d2a1fcb5610d10001145cc98 (diff) | |
download | bcm5719-llvm-2366ffd2cb5351918620f34ce997a5a7dc12c788.tar.gz bcm5719-llvm-2366ffd2cb5351918620f34ce997a5a7dc12c788.zip |
Add an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.
llvm-svn: 82653
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/CodeGen/ValueTypes.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h index 167a70ea10e..1f0dd210881 100644 --- a/llvm/include/llvm/CodeGen/ValueTypes.h +++ b/llvm/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 |