summaryrefslogtreecommitdiff
path: root/lib/VMCore/DataLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/DataLayout.cpp')
-rw-r--r--lib/VMCore/DataLayout.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/DataLayout.cpp b/lib/VMCore/DataLayout.cpp
index 8d7a8e267c..104e5da057 100644
--- a/lib/VMCore/DataLayout.cpp
+++ b/lib/VMCore/DataLayout.cpp
@@ -524,6 +524,14 @@ std::string DataLayout::getStringRepresentation() const {
return OS.str();
}
+unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const
+{
+ if (Ty->isPointerTy()) return getTypeSizeInBits(Ty);
+ if (Ty->isVectorTy()
+ && cast<VectorType>(Ty)->getElementType()->isPointerTy())
+ return getTypeSizeInBits(cast<VectorType>(Ty)->getElementType());
+ return getPointerSizeInBits(0);
+}
uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const {
assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");