llvm.org GIT mirror llvm / ac0eb3d
Use the range variant of transform instead of unpacking begin/end No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278476 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 3 years ago
7 changed file(s) with 13 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1616 #define LLVM_ADT_PRIORITYWORKLIST_H
1717
1818 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/STLExtras.h"
1920 #include "llvm/ADT/SmallVector.h"
2021 #include
2122 #include
185185 template
186186 bool remove_if(UnaryPredicate P) {
187187 typename vector_type::iterator I =
188 remove_if(vector_, TestAndEraseFromSet(P, set_));
188 llvm::remove_if(vector_, TestAndEraseFromSet(P, set_));
189189 if (I == vector_.end())
190190 return false;
191191 vector_.erase(I, vector_.end());
14331433 auto &IndexVector = Accesses.find(Access)->second;
14341434
14351435 SmallVector Insts;
1436 std::transform(IndexVector.begin(), IndexVector.end(),
1436 transform(IndexVector,
14371437 std::back_inserter(Insts),
14381438 [&](unsigned Idx) { return this->InstMap[Idx]; });
14391439 return Insts;
18221822
18231823 // Here we're relying on the SCEV Expander's cache to only emit code for the
18241824 // same bounds once.
1825 std::transform(
1826 PointerChecks.begin(), PointerChecks.end(),
1827 std::back_inserter(ChecksWithBounds),
1825 transform(
1826 PointerChecks, std::back_inserter(ChecksWithBounds),
18281827 [&](const RuntimePointerChecking::PointerCheck &Check) {
18291828 PointerBounds
18301829 First = expandBounds(Check.first, L, Loc, Exp, SE, PtrRtChecking),
28572857
28582858 static APInt readWideAPInt(ArrayRef Vals, unsigned TypeBits) {
28592859 SmallVector Words(Vals.size());
2860 std::transform(Vals.begin(), Vals.end(), Words.begin(),
2860 transform(Vals, Words.begin(),
28612861 BitcodeReader::decodeSignRotatedValue);
28622862
28632863 return APInt(TypeBits, Words);
997997 ///
998998 /// Erases all attachments matching the \c shouldRemove predicate.
999999 template void remove_if(PredTy shouldRemove) {
1000 Attachments.erase(remove_if(Attachments, shouldRemove), Attachments.end());
1000 Attachments.erase(llvm::remove_if(Attachments, shouldRemove),
1001 Attachments.end());
10011002 }
10021003 };
10031004
12651265 SmallVector Regs(N->op_begin() + 2, N->op_begin() + 2 + NumVecs);
12661266
12671267 if (Narrow)
1268 std::transform(Regs.begin(), Regs.end(), Regs.begin(),
1268 transform(Regs, Regs.begin(),
12691269 WidenVector(*CurDAG));
12701270
12711271 SDValue RegSeq = createQTuple(Regs);
13041304 SmallVector Regs(N->op_begin() + 1, N->op_begin() + 1 + NumVecs);
13051305
13061306 if (Narrow)
1307 std::transform(Regs.begin(), Regs.end(), Regs.begin(),
1307 transform(Regs, Regs.begin(),
13081308 WidenVector(*CurDAG));
13091309
13101310 SDValue RegSeq = createQTuple(Regs);
13591359 SmallVector Regs(N->op_begin() + 2, N->op_begin() + 2 + NumVecs);
13601360
13611361 if (Narrow)
1362 std::transform(Regs.begin(), Regs.end(), Regs.begin(),
1362 transform(Regs, Regs.begin(),
13631363 WidenVector(*CurDAG));
13641364
13651365 SDValue RegSeq = createQTuple(Regs);
13891389 SmallVector Regs(N->op_begin() + 1, N->op_begin() + 1 + NumVecs);
13901390
13911391 if (Narrow)
1392 std::transform(Regs.begin(), Regs.end(), Regs.begin(),
1392 transform(Regs, Regs.begin(),
13931393 WidenVector(*CurDAG));
13941394
13951395 SDValue RegSeq = createQTuple(Regs);
346346 // Collect the pointers of the candidate loads.
347347 // FIXME: SmallSet does not work with std::inserter.
348348 std::set CandLoadPtrs;
349 std::transform(Candidates.begin(), Candidates.end(),
349 transform(Candidates,
350350 std::inserter(CandLoadPtrs, CandLoadPtrs.begin()),
351351 std::mem_fn(&StoreToLoadForwardingCandidate::getLoadPtr));
352352