[llvm-commits] [llvm] r69353 - /llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
David Greene
greened at obbligato.org
Fri Apr 17 07:56:18 PDT 2009
Author: greened
Date: Fri Apr 17 09:56:18 2009
New Revision: 69353
URL: http://llvm.org/viewvc/llvm-project?rev=69353&view=rev
Log:
Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem.
Modified:
llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=69353&r1=69352&r2=69353&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Fri Apr 17 09:56:18 2009
@@ -565,11 +565,10 @@
// 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());
}
More information about the llvm-commits
mailing list