Fix using arg_end() - arg_begin() instead of arg_size()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185121 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault
2013-06-28 00:25:40 +00:00
parent ab7bcc60bc
commit 1bde770ccd

View File

@@ -1036,7 +1036,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
return false; return false;
} }
unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin()); unsigned NumActualArgs = CS.arg_size();
unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs); unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs);
CallSite::arg_iterator AI = CS.arg_begin(); CallSite::arg_iterator AI = CS.arg_begin();
@@ -1287,7 +1287,7 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS,
if (NestTy) { if (NestTy) {
Instruction *Caller = CS.getInstruction(); Instruction *Caller = CS.getInstruction();
std::vector<Value*> NewArgs; std::vector<Value*> NewArgs;
NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1); NewArgs.reserve(CS.arg_size() + 1);
SmallVector<AttributeSet, 8> NewAttrs; SmallVector<AttributeSet, 8> NewAttrs;
NewAttrs.reserve(Attrs.getNumSlots() + 1); NewAttrs.reserve(Attrs.getNumSlots() + 1);