Use the range variant of transform instead of unpacking begin/end

No functionality change is intended.

llvm-svn: 278476
This commit is contained in:
David Majnemer 2016-08-12 04:32:42 +00:00
parent c700490f48
commit 2d006e7673
7 changed files with 13 additions and 12 deletions

View File

@ -17,6 +17,7 @@
#define LLVM_ADT_PRIORITYWORKLIST_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include <algorithm>
#include <cassert>

View File

@ -186,7 +186,7 @@ public:
template <typename UnaryPredicate>
bool remove_if(UnaryPredicate P) {
typename vector_type::iterator I =
remove_if(vector_, TestAndEraseFromSet<UnaryPredicate>(P, set_));
llvm::remove_if(vector_, TestAndEraseFromSet<UnaryPredicate>(P, set_));
if (I == vector_.end())
return false;
vector_.erase(I, vector_.end());

View File

@ -1434,7 +1434,7 @@ MemoryDepChecker::getInstructionsForAccess(Value *Ptr, bool isWrite) const {
auto &IndexVector = Accesses.find(Access)->second;
SmallVector<Instruction *, 4> Insts;
std::transform(IndexVector.begin(), IndexVector.end(),
transform(IndexVector,
std::back_inserter(Insts),
[&](unsigned Idx) { return this->InstMap[Idx]; });
return Insts;
@ -1823,9 +1823,8 @@ static SmallVector<std::pair<PointerBounds, PointerBounds>, 4> expandBounds(
// Here we're relying on the SCEV Expander's cache to only emit code for the
// same bounds once.
std::transform(
PointerChecks.begin(), PointerChecks.end(),
std::back_inserter(ChecksWithBounds),
transform(
PointerChecks, std::back_inserter(ChecksWithBounds),
[&](const RuntimePointerChecking::PointerCheck &Check) {
PointerBounds
First = expandBounds(Check.first, L, Loc, Exp, SE, PtrRtChecking),

View File

@ -2858,7 +2858,7 @@ std::error_code BitcodeReader::resolveGlobalAndIndirectSymbolInits() {
static APInt readWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits) {
SmallVector<uint64_t, 8> Words(Vals.size());
std::transform(Vals.begin(), Vals.end(), Words.begin(),
transform(Vals, Words.begin(),
BitcodeReader::decodeSignRotatedValue);
return APInt(TypeBits, Words);

View File

@ -998,7 +998,8 @@ public:
///
/// Erases all attachments matching the \c shouldRemove predicate.
template <class PredTy> void remove_if(PredTy shouldRemove) {
Attachments.erase(remove_if(Attachments, shouldRemove), Attachments.end());
Attachments.erase(llvm::remove_if(Attachments, shouldRemove),
Attachments.end());
}
};

View File

@ -1266,7 +1266,7 @@ void AArch64DAGToDAGISel::SelectLoadLane(SDNode *N, unsigned NumVecs,
SmallVector<SDValue, 4> Regs(N->op_begin() + 2, N->op_begin() + 2 + NumVecs);
if (Narrow)
std::transform(Regs.begin(), Regs.end(), Regs.begin(),
transform(Regs, Regs.begin(),
WidenVector(*CurDAG));
SDValue RegSeq = createQTuple(Regs);
@ -1305,7 +1305,7 @@ void AArch64DAGToDAGISel::SelectPostLoadLane(SDNode *N, unsigned NumVecs,
SmallVector<SDValue, 4> Regs(N->op_begin() + 1, N->op_begin() + 1 + NumVecs);
if (Narrow)
std::transform(Regs.begin(), Regs.end(), Regs.begin(),
transform(Regs, Regs.begin(),
WidenVector(*CurDAG));
SDValue RegSeq = createQTuple(Regs);
@ -1360,7 +1360,7 @@ void AArch64DAGToDAGISel::SelectStoreLane(SDNode *N, unsigned NumVecs,
SmallVector<SDValue, 4> Regs(N->op_begin() + 2, N->op_begin() + 2 + NumVecs);
if (Narrow)
std::transform(Regs.begin(), Regs.end(), Regs.begin(),
transform(Regs, Regs.begin(),
WidenVector(*CurDAG));
SDValue RegSeq = createQTuple(Regs);
@ -1390,7 +1390,7 @@ void AArch64DAGToDAGISel::SelectPostStoreLane(SDNode *N, unsigned NumVecs,
SmallVector<SDValue, 4> Regs(N->op_begin() + 1, N->op_begin() + 1 + NumVecs);
if (Narrow)
std::transform(Regs.begin(), Regs.end(), Regs.begin(),
transform(Regs, Regs.begin(),
WidenVector(*CurDAG));
SDValue RegSeq = createQTuple(Regs);

View File

@ -347,7 +347,7 @@ public:
// Collect the pointers of the candidate loads.
// FIXME: SmallSet does not work with std::inserter.
std::set<Value *> CandLoadPtrs;
std::transform(Candidates.begin(), Candidates.end(),
transform(Candidates,
std::inserter(CandLoadPtrs, CandLoadPtrs.begin()),
std::mem_fn(&StoreToLoadForwardingCandidate::getLoadPtr));