[PATCH] D31841: [IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits directly
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 17 11:35:20 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL300475: [IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits… (authored by ctopper).
Changed prior to commit:
https://reviews.llvm.org/D31841?vs=94588&id=95468#toc
Repository:
rL LLVM
https://reviews.llvm.org/D31841
Files:
llvm/trunk/lib/IR/DataLayout.cpp
Index: llvm/trunk/lib/IR/DataLayout.cpp
===================================================================
--- llvm/trunk/lib/IR/DataLayout.cpp
+++ llvm/trunk/lib/IR/DataLayout.cpp
@@ -608,11 +608,8 @@
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);
-
- return getTypeSizeInBits(Ty->getScalarType());
+ Ty = Ty->getScalarType();
+ return getPointerSizeInBits(cast<PointerType>(Ty)->getAddressSpace());
}
/*!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31841.95468.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170417/601a595b/attachment.bin>
More information about the llvm-commits
mailing list