Skip to content

Commit 8ba3a23

Browse files
[llvm] Use llvm::copy (NFC) (llvm#137470)
1 parent fd3ca29 commit 8ba3a23

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3935,7 +3935,7 @@ DwarfDebug::getMD5AsBytes(const DIFile *File) const {
39353935
// An MD5 checksum is 16 bytes.
39363936
std::string ChecksumString = fromHex(Checksum->Value);
39373937
MD5::MD5Result CKMem;
3938-
std::copy(ChecksumString.begin(), ChecksumString.end(), CKMem.data());
3938+
llvm::copy(ChecksumString, CKMem.data());
39393939
return CKMem;
39403940
}
39413941

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ mergeVectorRegsToResultRegs(MachineIRBuilder &B, ArrayRef<Register> DstRegs,
354354
int NumDst = LCMTy.getSizeInBits() / LLTy.getSizeInBits();
355355

356356
SmallVector<Register, 8> PadDstRegs(NumDst);
357-
std::copy(DstRegs.begin(), DstRegs.end(), PadDstRegs.begin());
357+
llvm::copy(DstRegs, PadDstRegs.begin());
358358

359359
// Create the excess dead defs for the unmerge.
360360
for (int I = DstRegs.size(); I != NumDst; ++I)

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class DbgVariableValue {
134134
LocNoCount = LocNoVec.size();
135135
if (LocNoCount > 0) {
136136
LocNos = std::make_unique<unsigned[]>(LocNoCount);
137-
std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin());
137+
llvm::copy(LocNoVec, loc_nos_begin());
138138
}
139139
} else {
140140
LLVM_DEBUG(dbgs() << "Found debug value with 64+ unique machine "

llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class SDDbgValue {
165165
IsVariadic(IsVariadic) {
166166
assert(IsVariadic || L.size() == 1);
167167
assert(!(IsVariadic && IsIndirect));
168-
std::copy(L.begin(), L.end(), LocationOps);
169-
std::copy(Dependencies.begin(), Dependencies.end(), AdditionalDependencies);
168+
llvm::copy(L, LocationOps);
169+
llvm::copy(Dependencies, AdditionalDependencies);
170170
}
171171

172172
// We allocate arrays with the BumpPtrAllocator and never free or copy them,

llvm/lib/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void *ArgvArray::reset(LLVMContext &C, ExecutionEngine *EE,
347347
LLVM_DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void *)Dest.get()
348348
<< "\n");
349349

350-
std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest.get());
350+
llvm::copy(InputArgv[i], Dest.get());
351351
Dest[Size-1] = 0;
352352

353353
// Endian safe: Array[i] = (PointerTy)Dest;

llvm/lib/IR/Instructions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ void CallBrInst::init(FunctionType *FTy, Value *Fn, BasicBlock *Fallthrough,
936936

937937
// Set operands in order of their index to match use-list-order
938938
// prediction.
939-
std::copy(Args.begin(), Args.end(), op_begin());
939+
llvm::copy(Args, op_begin());
940940
NumIndirectDests = IndirectDests.size();
941941
setDefaultDest(Fallthrough);
942942
for (unsigned i = 0; i != NumIndirectDests; ++i)

llvm/lib/ObjCopy/COFF/COFFWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void COFFWriter::writeSections() {
317317
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Buf->getBufferStart()) +
318318
S.Header.PointerToRawData;
319319
ArrayRef<uint8_t> Contents = S.getContents();
320-
std::copy(Contents.begin(), Contents.end(), Ptr);
320+
llvm::copy(Contents, Ptr);
321321

322322
// For executable sections, pad the remainder of the raw data size with
323323
// 0xcc, which is int3 on x86.
@@ -355,7 +355,7 @@ template <class SymbolTy> void COFFWriter::writeSymbolStringTables() {
355355
// For file symbols, just write the string into the aux symbol slots,
356356
// assuming that the unwritten parts are initialized to zero in the memory
357357
// mapped file.
358-
std::copy(S.AuxFile.begin(), S.AuxFile.end(), Ptr);
358+
llvm::copy(S.AuxFile, Ptr);
359359
Ptr += S.Sym.NumberOfAuxSymbols * sizeof(SymbolTy);
360360
} else {
361361
// For other auxillary symbols, write their opaque payload into one symbol
@@ -364,7 +364,7 @@ template <class SymbolTy> void COFFWriter::writeSymbolStringTables() {
364364
// entry.
365365
for (const AuxSymbol &AuxSym : S.AuxData) {
366366
ArrayRef<uint8_t> Ref = AuxSym.getRef();
367-
std::copy(Ref.begin(), Ref.end(), Ptr);
367+
llvm::copy(Ref, Ptr);
368368
Ptr += sizeof(SymbolTy);
369369
}
370370
}

llvm/lib/ObjCopy/ELF/ELFObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Error ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) {
488488
"': " + toString(std::move(E)));
489489

490490
uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset;
491-
std::copy(Decompressed.begin(), Decompressed.end(), Buf);
491+
llvm::copy(Decompressed, Buf);
492492

493493
return Error::success();
494494
}

llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void updateLoadCommandPayloadString(LoadCommand &LC, StringRef S) {
161161

162162
LC.MachOLoadCommand.load_command_data.cmdsize = NewCmdsize;
163163
LC.Payload.assign(NewCmdsize - sizeof(LCType), 0);
164-
std::copy(S.begin(), S.end(), LC.Payload.begin());
164+
llvm::copy(S, LC.Payload.begin());
165165
}
166166

167167
static LoadCommand buildRPathLoadCommand(StringRef Path) {
@@ -172,7 +172,7 @@ static LoadCommand buildRPathLoadCommand(StringRef Path) {
172172
RPathLC.cmdsize = alignTo(sizeof(MachO::rpath_command) + Path.size() + 1, 8);
173173
LC.MachOLoadCommand.rpath_command_data = RPathLC;
174174
LC.Payload.assign(RPathLC.cmdsize - sizeof(MachO::rpath_command), 0);
175-
std::copy(Path.begin(), Path.end(), LC.Payload.begin());
175+
llvm::copy(Path, LC.Payload.begin());
176176
return LC;
177177
}
178178

llvm/lib/ObjCopy/XCOFF/XCOFFWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void XCOFFWriter::writeSections() {
7575
for (const Section &Sec : Obj.Sections) {
7676
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Buf->getBufferStart()) +
7777
Sec.SectionHeader.FileOffsetToRawData;
78-
Ptr = std::copy(Sec.Contents.begin(), Sec.Contents.end(), Ptr);
78+
Ptr = llvm::copy(Sec.Contents, Ptr);
7979
}
8080

8181
// Write relocations.

0 commit comments

Comments
 (0)