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

@@ -946,7 +946,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
int ix = FTy->getNumParams(); int ix = FTy->getNumParams();
// See if we can optimize any arguments passed through the varargs area of // See if we can optimize any arguments passed through the varargs area of
// the call. // the call.
for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(), for (CallSite::arg_iterator I = CS.arg_begin() + FTy->getNumParams(),
E = CS.arg_end(); I != E; ++I, ++ix) { E = CS.arg_end(); I != E; ++I, ++ix) {
CastInst *CI = dyn_cast<CastInst>(*I); CastInst *CI = dyn_cast<CastInst>(*I);
if (CI && isSafeToEliminateVarargsCast(CS, CI, TD, ix)) { if (CI && isSafeToEliminateVarargsCast(CS, CI, TD, ix)) {
@@ -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);