diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-26 17:37:20 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-26 17:37:20 +0000 |
commit | 6f4be90570e54ce89dc053c43918b39cf439dff9 (patch) | |
tree | 56d3e3825b60c69fde7f2ec7172fe88ed64f5130 /llvm/include | |
parent | 8ea2e40296a0cb143cb0b431a18a17aaee0100f3 (diff) | |
download | bcm5719-llvm-6f4be90570e54ce89dc053c43918b39cf439dff9.tar.gz bcm5719-llvm-6f4be90570e54ce89dc053c43918b39cf439dff9.zip |
Re-add DataLayout pointer size convenience functions.
These were reverted in r167222 along with the rest
of the last different address space pointer size attempt.
These will be used in later commits.
llvm-svn: 187223
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/IR/DataLayout.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h index c15591b6d25..269edeb9f36 100644 --- a/llvm/include/llvm/IR/DataLayout.h +++ b/llvm/include/llvm/IR/DataLayout.h @@ -271,6 +271,18 @@ public: unsigned getPointerSizeInBits(unsigned AS = 0) const { return getPointerSize(AS) * 8; } + + /// Layout pointer size, in bits, based on the type. If this function is + /// called with a pointer type, then the type size of the pointer is returned. + /// If this function is called with a vector of pointers, then the type size + /// of the pointer is returned. This should only be called with a pointer or + /// vector of pointers. + unsigned getPointerTypeSizeInBits(Type *) const; + + unsigned getPointerTypeSize(Type *Ty) const { + return getPointerTypeSizeInBits(Ty) / 8; + } + /// Size examples: /// /// Type SizeInBits StoreSizeInBits AllocSizeInBits[*] |