aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-04-17 14:56:18 +0000
committerDavid Greene <greened@obbligato.org>2009-04-17 14:56:18 +0000
commit5b7dfbd89a0a0b7b59603bf9eb0f3f58534b4dd5 (patch)
tree577c67107b31f3c72f3d82b991b75ac0ad8f4cfc /lib/Transforms/IPO/ArgumentPromotion.cpp
parent2a5a12cd6930d48f6c670a58d0d6be2266e06f64 (diff)
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
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index b562c425aa..2bb6428060 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -565,11 +565,10 @@ Function *ArgPromotion::DoPromotion(Function *F,
// Add a parameter to the function for each element passed in.
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
E = ArgIndices.end(); SI != E; ++SI) {
- unsigned num = SI->size();
// not allowed to dereference ->begin() if size() is 0
Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
- num ? &*SI->begin(): 0,
- num));
+ SI->begin(),
+ SI->end()));
assert(Params.back());
}