summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-02-01 20:44:47 +0000
committerJames Y Knight <jyknight@google.com>2019-02-01 20:44:47 +0000
commit7716075a1729ead67844574fdb34579894122992 (patch)
tree1a3b91f53223202ab65c910dbc26979f5f05201c /llvm/lib/Transforms/IPO
parent14359ef1b6a0610ac91df5f5a91c88a0b51c187c (diff)
downloadbcm5719-llvm-7716075a1729ead67844574fdb34579894122992.tar.gz
bcm5719-llvm-7716075a1729ead67844574fdb34579894122992.zip
[opaque pointer types] Pass value type to GetElementPtr creation.
This cleans up all GetElementPtr creation in LLVM to explicitly pass a value type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57173 llvm-svn: 352913
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 5080e02b135..7f3644b1bff 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -729,7 +729,8 @@ static bool OptimizeAwayTrappingUsesOfValue(Value *V, Constant *NewV) {
break;
if (Idxs.size() == GEPI->getNumOperands()-1)
Changed |= OptimizeAwayTrappingUsesOfValue(
- GEPI, ConstantExpr::getGetElementPtr(nullptr, NewV, Idxs));
+ GEPI, ConstantExpr::getGetElementPtr(GEPI->getSourceElementType(),
+ NewV, Idxs));
if (GEPI->use_empty()) {
Changed = true;
GEPI->eraseFromParent();
OpenPOWER on IntegriCloud