diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-03-30 21:41:43 +0000 |
commit | d288fb86810bbac1c2890b70e9ecd6f03744dfa7 (patch) | |
tree | 22054f443f756bd7ca2d32649f00aaea4ebf4245 /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | |
parent | 0d68b4c5ed89f1c8a9e4466badf69de159ee20d7 (diff) | |
download | llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.zip llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.tar.gz llvm-d288fb86810bbac1c2890b70e9ecd6f03744dfa7.tar.bz2 |
[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/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 46480bd..430df3d 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -674,8 +674,9 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, for (ScalarizeTable::iterator SI = ArgIndices.begin(), E = ArgIndices.end(); SI != E; ++SI) { // not allowed to dereference ->begin() if size() is 0 - Params.push_back( - GetElementPtrInst::getIndexedType(I->getType(), SI->second)); + Params.push_back(GetElementPtrInst::getIndexedType( + cast<PointerType>(I->getType()->getScalarType())->getElementType(), + SI->second)); assert(Params.back()); } |