mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-15 16:38:41 +00:00
Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2a5a12cd69
commit
5b7dfbd89a
@ -565,11 +565,10 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
|||||||
// Add a parameter to the function for each element passed in.
|
// Add a parameter to the function for each element passed in.
|
||||||
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
|
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
|
||||||
E = ArgIndices.end(); SI != E; ++SI) {
|
E = ArgIndices.end(); SI != E; ++SI) {
|
||||||
unsigned num = SI->size();
|
|
||||||
// not allowed to dereference ->begin() if size() is 0
|
// not allowed to dereference ->begin() if size() is 0
|
||||||
Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
|
Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
|
||||||
num ? &*SI->begin(): 0,
|
SI->begin(),
|
||||||
num));
|
SI->end()));
|
||||||
assert(Params.back());
|
assert(Params.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user