summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DataLayout.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index adb2d7a62ac..d1096d74242 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -507,6 +507,16 @@ std::string DataLayout::getStringRepresentation() const {
return OS.str();
}
+unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const {
+ assert(Ty->isPtrOrPtrVectorTy() &&
+ "This should only be called with a pointer or pointer vector type");
+
+ if (Ty->isPointerTy())
+ return getTypeSizeInBits(Ty);
+
+ Type *EleTy = cast<VectorType>(Ty)->getElementType();
+ return getTypeSizeInBits(EleTy);
+}
/*!
\param abi_or_pref Flag that determines which alignment is returned. true
OpenPOWER on IntegriCloud