[llvm] r347126 - Use llvm::copy. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 16 17:44:25 PST 2018
Author: maskray
Date: Fri Nov 16 17:44:25 2018
New Revision: 347126
URL: http://llvm.org/viewvc/llvm-project?rev=347126&view=rev
Log:
Use llvm::copy. NFC
Modified:
llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/trunk/lib/CodeGen/MIRCanonicalizerPass.cpp
llvm/trunk/lib/CodeGen/MachineFunction.cpp
llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/trunk/lib/IR/Attributes.cpp
llvm/trunk/lib/IR/Constants.cpp
llvm/trunk/lib/IR/Instructions.cpp
llvm/trunk/lib/IR/Metadata.cpp
llvm/trunk/lib/Object/Object.cpp
llvm/trunk/lib/Object/WindowsResource.cpp
llvm/trunk/lib/Support/Path.cpp
llvm/trunk/lib/Support/RandomNumberGenerator.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Fri Nov 16 17:44:25 2018
@@ -420,7 +420,7 @@ void RuntimePointerChecking::groupChecks
// We've computed the grouped checks for this partition.
// Save the results and continue with the next one.
- std::copy(Groups.begin(), Groups.end(), std::back_inserter(CheckingGroups));
+ llvm::copy(Groups, std::back_inserter(CheckingGroups));
}
}
Modified: llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSAUpdater.cpp Fri Nov 16 17:44:25 2018
@@ -93,7 +93,7 @@ MemoryAccess *MemorySSAUpdater::getPrevi
// FIXME: Figure out whether this is dead code and if so remove it.
if (!std::equal(Phi->op_begin(), Phi->op_end(), PhiOps.begin())) {
// These will have been filled in by the recursive read we did above.
- std::copy(PhiOps.begin(), PhiOps.end(), Phi->op_begin());
+ llvm::copy(PhiOps, Phi->op_begin());
std::copy(pred_begin(BB), pred_end(BB), Phi->block_begin());
}
} else {
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Nov 16 17:44:25 2018
@@ -4026,7 +4026,7 @@ void ModuleBitcodeWriter::writeModuleHas
if (ModHash)
// Save the written hash value.
- std::copy(std::begin(Vals), std::end(Vals), std::begin(*ModHash));
+ llvm::copy(Vals, std::begin(*ModHash));
}
}
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Nov 16 17:44:25 2018
@@ -215,7 +215,7 @@ ArrayRef<unsigned> IRTranslator::getOrCr
unsigned Idx = 0;
while (auto Elt = C.getAggregateElement(Idx++)) {
auto EltRegs = getOrCreateVRegs(*Elt);
- std::copy(EltRegs.begin(), EltRegs.end(), std::back_inserter(*VRegs));
+ llvm::copy(EltRegs, std::back_inserter(*VRegs));
}
} else {
assert(SplitTys.size() == 1 && "unexpectedly split LLT");
Modified: llvm/trunk/lib/CodeGen/MIRCanonicalizerPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRCanonicalizerPass.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRCanonicalizerPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRCanonicalizerPass.cpp Fri Nov 16 17:44:25 2018
@@ -677,8 +677,7 @@ static bool runOnBasicBlock(MachineBasic
std::vector<MachineInstr *> Candidates = populateCandidates(MBB);
std::vector<MachineInstr *> VisitedMIs;
- std::copy(Candidates.begin(), Candidates.end(),
- std::back_inserter(VisitedMIs));
+ llvm::copy(Candidates, std::back_inserter(VisitedMIs));
std::vector<TypedVReg> VRegs;
for (auto candidate : Candidates) {
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Fri Nov 16 17:44:25 2018
@@ -435,7 +435,7 @@ MachineFunction::createMIExtraInfo(Array
const char *MachineFunction::createExternalSymbolName(StringRef Name) {
char *Dest = Allocator.Allocate<char>(Name.size() + 1);
- std::copy(Name.begin(), Name.end(), Dest);
+ llvm::copy(Name, Dest);
Dest[Name.size()] = 0;
return Dest;
}
Modified: llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp Fri Nov 16 17:44:25 2018
@@ -218,8 +218,7 @@ computeHeightResources(const MachineBasi
// The trace tail is done.
if (!TBI->Succ) {
TBI->Tail = MBB->getNumber();
- std::copy(PRCycles.begin(), PRCycles.end(),
- ProcResourceHeights.begin() + PROffset);
+ llvm::copy(PRCycles, ProcResourceHeights.begin() + PROffset);
return;
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Nov 16 17:44:25 2018
@@ -1685,7 +1685,7 @@ SDValue SelectionDAG::getVectorShuffle(E
// SDNode doesn't have access to it. This memory will be "leaked" when
// the node is deallocated, but recovered when the NodeAllocator is released.
int *MaskAlloc = OperandAllocator.Allocate<int>(NElts);
- std::copy(MaskVec.begin(), MaskVec.end(), MaskAlloc);
+ llvm::copy(MaskVec, MaskAlloc);
auto *N = newSDNode<ShuffleVectorSDNode>(VT, dl.getIROrder(),
dl.getDebugLoc(), MaskAlloc);
@@ -7039,7 +7039,7 @@ SDVTList SelectionDAG::getVTList(ArrayRe
SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
if (!Result) {
EVT *Array = Allocator.Allocate<EVT>(NumVTs);
- std::copy(VTs.begin(), VTs.end(), Array);
+ llvm::copy(VTs, Array);
Result = new (Allocator) SDVTListNode(ID.Intern(Allocator), Array, NumVTs);
VTListMap.InsertNode(Result, IP);
}
@@ -7185,7 +7185,7 @@ void SelectionDAG::setNodeMemRefs(Machin
MachineMemOperand **MemRefsBuffer =
Allocator.template Allocate<MachineMemOperand *>(NewMemRefs.size());
- std::copy(NewMemRefs.begin(), NewMemRefs.end(), MemRefsBuffer);
+ llvm::copy(NewMemRefs, MemRefsBuffer);
N->MemRefs = MemRefsBuffer;
N->NumMemRefs = static_cast<int>(NewMemRefs.size());
}
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp Fri Nov 16 17:44:25 2018
@@ -124,7 +124,7 @@ DWARFDebugLoc::parseOneLocationList(DWAR
StringRef str = Data.getData().substr(*Offset, Bytes);
*Offset += Bytes;
E.Loc.reserve(str.size());
- std::copy(str.begin(), str.end(), std::back_inserter(E.Loc));
+ llvm::copy(str, std::back_inserter(E.Loc));
LL.Entries.push_back(std::move(E));
}
}
@@ -189,7 +189,7 @@ DWARFDebugLoclists::parseOneLocationList
StringRef str = Data.getData().substr(*Offset, Bytes);
*Offset += Bytes;
E.Loc.resize(str.size());
- std::copy(str.begin(), str.end(), E.Loc.begin());
+ llvm::copy(str, E.Loc.begin());
}
LL.Entries.push_back(std::move(E));
Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Fri Nov 16 17:44:25 2018
@@ -639,7 +639,7 @@ LLVM_DUMP_METHOD void AttributeSet::dump
AttributeSetNode::AttributeSetNode(ArrayRef<Attribute> Attrs)
: AvailableAttrs(0), NumAttrs(Attrs.size()) {
// There's memory after the node where we can store the entries in.
- std::copy(Attrs.begin(), Attrs.end(), getTrailingObjects<Attribute>());
+ llvm::copy(Attrs, getTrailingObjects<Attribute>());
for (const auto I : *this) {
if (!I.isStringAttribute()) {
@@ -809,7 +809,7 @@ AttributeListImpl::AttributeListImpl(LLV
assert(!Sets.empty() && "pointless AttributeListImpl");
// There's memory after the node where we can store the entries in.
- std::copy(Sets.begin(), Sets.end(), getTrailingObjects<AttributeSet>());
+ llvm::copy(Sets, getTrailingObjects<AttributeSet>());
// Initialize AvailableFunctionAttrs summary bitset.
static_assert(Attribute::EndAttrKinds <=
Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Fri Nov 16 17:44:25 2018
@@ -940,7 +940,7 @@ ConstantAggregate::ConstantAggregate(Com
ArrayRef<Constant *> V)
: Constant(T, VT, OperandTraits<ConstantAggregate>::op_end(this) - V.size(),
V.size()) {
- std::copy(V.begin(), V.end(), op_begin());
+ llvm::copy(V, op_begin());
// Check that types match, unless this is an opaque struct.
if (auto *ST = dyn_cast<StructType>(T))
Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Fri Nov 16 17:44:25 2018
@@ -275,7 +275,7 @@ void CallInst::init(FunctionType *FTy, V
"Calling a function with a bad signature!");
#endif
- std::copy(Args.begin(), Args.end(), op_begin());
+ llvm::copy(Args, op_begin());
auto It = populateBundleOperandInfos(Bundles, Args.size());
(void)It;
@@ -577,7 +577,7 @@ void InvokeInst::init(FunctionType *FTy,
"Invoking a function with a bad signature!");
#endif
- std::copy(Args.begin(), Args.end(), op_begin());
+ llvm::copy(Args, op_begin());
auto It = populateBundleOperandInfos(Bundles, Args.size());
(void)It;
@@ -834,7 +834,7 @@ void CatchSwitchInst::removeHandler(hand
void FuncletPadInst::init(Value *ParentPad, ArrayRef<Value *> Args,
const Twine &NameStr) {
assert(getNumOperands() == 1 + Args.size() && "NumOperands not set up?");
- std::copy(Args.begin(), Args.end(), op_begin());
+ llvm::copy(Args, op_begin());
setParentPad(ParentPad);
setName(NameStr);
}
@@ -1390,7 +1390,7 @@ void GetElementPtrInst::init(Value *Ptr,
assert(getNumOperands() == 1 + IdxList.size() &&
"NumOperands not initialized?");
Op<0>() = Ptr;
- std::copy(IdxList.begin(), IdxList.end(), op_begin() + 1);
+ llvm::copy(IdxList, op_begin() + 1);
setName(Name);
}
Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Fri Nov 16 17:44:25 2018
@@ -1484,7 +1484,7 @@ void GlobalObject::copyMetadata(const Gl
std::vector<uint64_t> Elements(OrigElements.size() + 2);
Elements[0] = dwarf::DW_OP_plus_uconst;
Elements[1] = Offset;
- std::copy(OrigElements.begin(), OrigElements.end(), Elements.begin() + 2);
+ llvm::copy(OrigElements, Elements.begin() + 2);
E = DIExpression::get(getContext(), Elements);
Attachment = DIGlobalVariableExpression::get(getContext(), GV, E);
}
Modified: llvm/trunk/lib/Object/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Object.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Object.cpp (original)
+++ llvm/trunk/lib/Object/Object.cpp Fri Nov 16 17:44:25 2018
@@ -229,7 +229,7 @@ const char *LLVMGetRelocationTypeName(LL
SmallVector<char, 0> ret;
(*unwrap(RI))->getTypeName(ret);
char *str = static_cast<char*>(safe_malloc(ret.size()));
- std::copy(ret.begin(), ret.end(), str);
+ llvm::copy(ret, str);
return str;
}
Modified: llvm/trunk/lib/Object/WindowsResource.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/WindowsResource.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Object/WindowsResource.cpp (original)
+++ llvm/trunk/lib/Object/WindowsResource.cpp Fri Nov 16 17:44:25 2018
@@ -259,7 +259,7 @@ WindowsResourceParser::TreeNode::addChil
std::vector<UTF16> EndianCorrectedName;
if (sys::IsBigEndianHost) {
EndianCorrectedName.resize(NameRef.size() + 1);
- std::copy(NameRef.begin(), NameRef.end(), EndianCorrectedName.begin() + 1);
+ llvm::copy(NameRef, EndianCorrectedName.begin() + 1);
EndianCorrectedName[0] = UNI_UTF16_BYTE_ORDER_MARK_SWAPPED;
CorrectedName = makeArrayRef(EndianCorrectedName);
} else
@@ -501,8 +501,7 @@ void WindowsResourceCOFFWriter::writeFir
void WindowsResourceCOFFWriter::writeSecondSection() {
// Now write the .rsrc$02 section.
for (auto const &RawDataEntry : Data) {
- std::copy(RawDataEntry.begin(), RawDataEntry.end(),
- BufferStart + CurrentOffset);
+ llvm::copy(RawDataEntry, BufferStart + CurrentOffset);
CurrentOffset += alignTo(RawDataEntry.size(), sizeof(uint64_t));
}
@@ -672,7 +671,7 @@ void WindowsResourceCOFFWriter::writeDir
support::endian::write16le(BufferStart + CurrentOffset, Length);
CurrentOffset += sizeof(uint16_t);
auto *Start = reinterpret_cast<UTF16 *>(BufferStart + CurrentOffset);
- std::copy(String.begin(), String.end(), Start);
+ llvm::copy(String, Start);
CurrentOffset += Length * sizeof(UTF16);
TotalStringTableSize += Length * sizeof(UTF16) + sizeof(uint16_t);
}
Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Fri Nov 16 17:44:25 2018
@@ -533,7 +533,7 @@ void replace_path_prefix(SmallVectorImpl
// If prefixes have the same size we can simply copy the new one over.
if (OldPrefix.size() == NewPrefix.size()) {
- std::copy(NewPrefix.begin(), NewPrefix.end(), Path.begin());
+ llvm::copy(NewPrefix, Path.begin());
return;
}
Modified: llvm/trunk/lib/Support/RandomNumberGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/RandomNumberGenerator.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Support/RandomNumberGenerator.cpp (original)
+++ llvm/trunk/lib/Support/RandomNumberGenerator.cpp Fri Nov 16 17:44:25 2018
@@ -49,7 +49,7 @@ RandomNumberGenerator::RandomNumberGener
Data[0] = Seed;
Data[1] = Seed >> 32;
- std::copy(Salt.begin(), Salt.end(), Data.begin() + 2);
+ llvm::copy(Salt, Data.begin() + 2);
std::seed_seq SeedSeq(Data.begin(), Data.end());
Generator.seed(SeedSeq);
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Nov 16 17:44:25 2018
@@ -37351,7 +37351,7 @@ static bool isHorizontalBinOp(SDValue &L
if (!LHS.getOperand(1).isUndef())
B = LHS.getOperand(1);
ArrayRef<int> Mask = cast<ShuffleVectorSDNode>(LHS.getNode())->getMask();
- std::copy(Mask.begin(), Mask.end(), LMask.begin());
+ llvm::copy(Mask, LMask.begin());
} else {
A = LHS;
for (unsigned i = 0; i != NumElts; ++i)
@@ -37368,7 +37368,7 @@ static bool isHorizontalBinOp(SDValue &L
if (!RHS.getOperand(1).isUndef())
D = RHS.getOperand(1);
ArrayRef<int> Mask = cast<ShuffleVectorSDNode>(RHS.getNode())->getMask();
- std::copy(Mask.begin(), Mask.end(), RMask.begin());
+ llvm::copy(Mask, RMask.begin());
} else {
C = RHS;
for (unsigned i = 0; i != NumElts; ++i)
Modified: llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp Fri Nov 16 17:44:25 2018
@@ -1416,7 +1416,7 @@ bool CHRScopeSorter(CHRScope *Scope1, CH
void CHR::sortScopes(SmallVectorImpl<CHRScope *> &Input,
SmallVectorImpl<CHRScope *> &Output) {
Output.resize(Input.size());
- std::copy(Input.begin(), Input.end(), Output.begin());
+ llvm::copy(Input, Output.begin());
std::stable_sort(Output.begin(), Output.end(), CHRScopeSorter);
}
Modified: llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp Fri Nov 16 17:44:25 2018
@@ -258,14 +258,14 @@ public:
/// Create a PHI from an array of incoming values and incoming blocks.
template <typename VArray, typename BArray>
ModelledPHI(const VArray &V, const BArray &B) {
- std::copy(V.begin(), V.end(), std::back_inserter(Values));
- std::copy(B.begin(), B.end(), std::back_inserter(Blocks));
+ llvm::copy(V, std::back_inserter(Values));
+ llvm::copy(B, std::back_inserter(Blocks));
}
/// Create a PHI from [I[OpNum] for I in Insts].
template <typename BArray>
ModelledPHI(ArrayRef<Instruction *> Insts, unsigned OpNum, const BArray &B) {
- std::copy(B.begin(), B.end(), std::back_inserter(Blocks));
+ llvm::copy(B, std::back_inserter(Blocks));
for (auto *I : Insts)
Values.push_back(I->getOperand(OpNum));
}
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Fri Nov 16 17:44:25 2018
@@ -3175,8 +3175,7 @@ bool NewGVN::singleReachablePHIPath(
auto FilteredPhiArgs =
make_filter_range(MP->operands(), ReachableOperandPred);
SmallVector<const Value *, 32> OperandList;
- std::copy(FilteredPhiArgs.begin(), FilteredPhiArgs.end(),
- std::back_inserter(OperandList));
+ llvm::copy(FilteredPhiArgs, std::back_inserter(OperandList));
bool Okay = is_splat(OperandList);
if (Okay)
return singleReachablePHIPath(Visited, cast<MemoryAccess>(OperandList[0]),
Modified: llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp?rev=347126&r1=347125&r2=347126&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp Fri Nov 16 17:44:25 2018
@@ -97,14 +97,14 @@ void SectionWriter::visit(const Section
if (Sec.Type == SHT_NOBITS)
return;
uint8_t *Buf = Out.getBufferStart() + Sec.Offset;
- std::copy(std::begin(Sec.Contents), std::end(Sec.Contents), Buf);
+ llvm::copy(Sec.Contents, Buf);
}
void Section::accept(SectionVisitor &Visitor) const { Visitor.visit(*this); }
void SectionWriter::visit(const OwnedDataSection &Sec) {
uint8_t *Buf = Out.getBufferStart() + Sec.Offset;
- std::copy(std::begin(Sec.Data), std::end(Sec.Data), Buf);
+ llvm::copy(Sec.Data, Buf);
}
static const std::vector<uint8_t> ZlibGnuMagic = {'Z', 'L', 'I', 'B'};
@@ -269,7 +269,7 @@ template <class ELFT>
void ELFSectionWriter<ELFT>::visit(const SectionIndexSection &Sec) {
uint8_t *Buf = Out.getBufferStart() + Sec.Offset;
auto *IndexesBuffer = reinterpret_cast<Elf_Word *>(Buf);
- std::copy(std::begin(Sec.Indexes), std::end(Sec.Indexes), IndexesBuffer);
+ llvm::copy(Sec.Indexes, IndexesBuffer);
}
void SectionIndexSection::initialize(SectionTableRef SecTable) {
@@ -554,7 +554,7 @@ void RelocationSection::markSymbols() {
}
void SectionWriter::visit(const DynamicRelocationSection &Sec) {
- std::copy(std::begin(Sec.Contents), std::end(Sec.Contents),
+ llvm::copy(Sec.Contents,
Out.getBufferStart() + Sec.Offset);
}
@@ -641,7 +641,7 @@ void ELFSectionWriter<ELFT>::visit(const
Elf_Word *CRC =
reinterpret_cast<Elf_Word *>(Buf + Sec.Size - sizeof(Elf_Word));
*CRC = Sec.CRC32;
- std::copy(std::begin(Sec.FileName), std::end(Sec.FileName), File);
+ llvm::copy(Sec.FileName, File);
}
void GnuDebugLinkSection::accept(SectionVisitor &Visitor) const {
More information about the llvm-commits
mailing list