summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-03-30 21:41:43 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-03-30 21:41:43 +0000
commitd288fb86810bbac1c2890b70e9ecd6f03744dfa7 (patch)
tree22054f443f756bd7ca2d32649f00aaea4ebf4245 /llvm/lib/Analysis/ConstantFolding.cpp
parent0d68b4c5ed89f1c8a9e4466badf69de159ee20d7 (diff)
downloadbcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.tar.gz
bcm5719-llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.zip
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several callers - I'll essentially just have to keep pushing that up the stack until I can eliminate every call to it... llvm-svn: 233604
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 995465dcb24..5bc84f43f9e 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -681,8 +681,9 @@ static Constant *CastGEPIndices(ArrayRef<Constant *> Ops, Type *ResultTy,
for (unsigned i = 1, e = Ops.size(); i != e; ++i) {
if ((i == 1 ||
!isa<StructType>(GetElementPtrInst::getIndexedType(
- Ops[0]->getType(),
- Ops.slice(1, i - 1)))) &&
+ cast<PointerType>(Ops[0]->getType()->getScalarType())
+ ->getElementType(),
+ Ops.slice(1, i - 1)))) &&
Ops[i]->getType() != IntPtrTy) {
Any = true;
NewIdxs.push_back(ConstantExpr::getCast(CastInst::getCastOpcode(Ops[i],
OpenPOWER on IntegriCloud