summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-01-22 01:33:43 +0000
committerEduard Burtescu <edy.burt@gmail.com>2016-01-22 01:33:43 +0000
commit093ae49077dc7a12624262110e8c2c88808c58bf (patch)
treefd90a94a252443b8dcbcb16df331fc6006cbd68e /llvm/lib/IR/DataLayout.cpp
parentb008fd4d895591013dad05bdeb2276085689b774 (diff)
downloadbcm5719-llvm-093ae49077dc7a12624262110e8c2c88808c58bf.tar.gz
bcm5719-llvm-093ae49077dc7a12624262110e8c2c88808c58bf.zip
[opaque pointer types] [NFC] gep_type_{begin,end} now take source element type and address space.
Reviewers: mjacob, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16436 llvm-svn: 258474
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 8230f429b05..0f2e5ba5895 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -729,8 +729,11 @@ uint64_t DataLayout::getIndexedOffset(Type *ptrTy,
assert(Ty->isPointerTy() && "Illegal argument for getIndexedOffset()");
uint64_t Result = 0;
+ // We can use 0 as the address space as we don't need
+ // to get pointer types back from gep_type_iterator.
+ unsigned AS = 0;
generic_gep_type_iterator<Value* const*>
- TI = gep_type_begin(ptrTy, Indices);
+ TI = gep_type_begin(ptrTy->getPointerElementType(), AS, Indices);
for (unsigned CurIDX = 0, EndIDX = Indices.size(); CurIDX != EndIDX;
++CurIDX, ++TI) {
if (StructType *STy = dyn_cast<StructType>(*TI)) {
OpenPOWER on IntegriCloud