[llvm] r278476 - Use the range variant of transform instead of unpacking begin/end
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 21:32:43 PDT 2016
Author: majnemer
Date: Thu Aug 11 23:32:42 2016
New Revision: 278476
URL: http://llvm.org/viewvc/llvm-project?rev=278476&view=rev
Log:
Use the range variant of transform instead of unpacking begin/end
No functionality change is intended.
Modified:
llvm/trunk/include/llvm/ADT/PriorityWorklist.h
llvm/trunk/include/llvm/ADT/SetVector.h
llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/IR/LLVMContextImpl.h
llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp
Modified: llvm/trunk/include/llvm/ADT/PriorityWorklist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PriorityWorklist.h?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PriorityWorklist.h (original)
+++ llvm/trunk/include/llvm/ADT/PriorityWorklist.h Thu Aug 11 23:32:42 2016
@@ -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>
Modified: llvm/trunk/include/llvm/ADT/SetVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SetVector.h?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SetVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SetVector.h Thu Aug 11 23:32:42 2016
@@ -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());
Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Thu Aug 11 23:32:42 2016
@@ -1434,7 +1434,7 @@ MemoryDepChecker::getInstructionsForAcce
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<PointerBoun
// 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),
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Aug 11 23:32:42 2016
@@ -2858,7 +2858,7 @@ std::error_code BitcodeReader::resolveGl
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);
Modified: llvm/trunk/lib/IR/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/IR/LLVMContextImpl.h Thu Aug 11 23:32:42 2016
@@ -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());
}
};
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Thu Aug 11 23:32:42 2016
@@ -1266,7 +1266,7 @@ void AArch64DAGToDAGISel::SelectLoadLane
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::SelectPostLoad
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::SelectStoreLan
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::SelectPostStor
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);
Modified: llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp?rev=278476&r1=278475&r2=278476&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp Thu Aug 11 23:32:42 2016
@@ -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));
More information about the llvm-commits
mailing list