From: Matt Arsenault Date: Fri, 28 Jun 2013 00:25:40 +0000 (+0000) Subject: Fix using arg_end() - arg_begin() instead of arg_size() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1bde770ccd35b27e0421e54fcdde1f33cdba0f7a;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index 78b4a2c6c9e..815db335ea4 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -946,7 +946,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { int ix = FTy->getNumParams(); // See if we can optimize any arguments passed through the varargs area of // 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) { CastInst *CI = dyn_cast(*I); if (CI && isSafeToEliminateVarargsCast(CS, CI, TD, ix)) { @@ -1036,7 +1036,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { return false; } - unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin()); + unsigned NumActualArgs = CS.arg_size(); unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs); CallSite::arg_iterator AI = CS.arg_begin(); @@ -1287,7 +1287,7 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS, if (NestTy) { Instruction *Caller = CS.getInstruction(); std::vector NewArgs; - NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1); + NewArgs.reserve(CS.arg_size() + 1); SmallVector NewAttrs; NewAttrs.reserve(Attrs.getNumSlots() + 1);