Skip to content

Commit 8ba3a23

Browse files
[llvm] Use llvm::copy (NFC) (#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.

llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static Error dumpSectionToFile(StringRef SecName, StringRef Filename,
4747
if (!BufferOrErr)
4848
return createFileError(Filename, BufferOrErr.takeError());
4949
std::unique_ptr<FileOutputBuffer> Buf = std::move(*BufferOrErr);
50-
std::copy(Contents.begin(), Contents.end(), Buf->getBufferStart());
50+
llvm::copy(Contents, Buf->getBufferStart());
5151
if (Error E = Buf->commit())
5252
return createFileError(Filename, std::move(E));
5353
return Error::success();

llvm/lib/ObjectYAML/COFFEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct COFFParser {
6565
StringRef Name = Sec.Name;
6666

6767
if (Name.size() <= COFF::NameSize) {
68-
std::copy(Name.begin(), Name.end(), Sec.Header.Name);
68+
llvm::copy(Name, Sec.Header.Name);
6969
} else {
7070
// Add string to the string table and format the index for output.
7171
unsigned Index = getStringIndex(Name);
@@ -75,7 +75,7 @@ struct COFFParser {
7575
return false;
7676
}
7777
Sec.Header.Name[0] = '/';
78-
std::copy(str.begin(), str.end(), Sec.Header.Name + 1);
78+
llvm::copy(str, Sec.Header.Name + 1);
7979
}
8080

8181
if (Sec.Alignment) {

llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,11 +1269,11 @@ OpRef HvxSelector::packs(ShuffleMask SM, OpRef Va, OpRef Vb,
12691269
return OpRef::fail();
12701270

12711271
if (Vb.isUndef()) {
1272-
std::copy(SM.Mask.begin(), SM.Mask.end(), NewMask.begin());
1272+
llvm::copy(SM.Mask, NewMask.begin());
12731273
return Va;
12741274
}
12751275
if (Va.isUndef()) {
1276-
std::copy(SM.Mask.begin(), SM.Mask.end(), NewMask.begin());
1276+
llvm::copy(SM.Mask, NewMask.begin());
12771277
ShuffleVectorSDNode::commuteMask(NewMask);
12781278
return Vb;
12791279
}

llvm/lib/Transforms/Scalar/NewGVN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,14 +1267,14 @@ NewGVN::createAggregateValueExpression(Instruction *I) const {
12671267
AggregateValueExpression(I->getNumOperands(), II->getNumIndices());
12681268
setBasicExpressionInfo(I, E);
12691269
E->allocateIntOperands(ExpressionAllocator);
1270-
std::copy(II->idx_begin(), II->idx_end(), int_op_inserter(E));
1270+
llvm::copy(II->indices(), int_op_inserter(E));
12711271
return E;
12721272
} else if (auto *EI = dyn_cast<ExtractValueInst>(I)) {
12731273
auto *E = new (ExpressionAllocator)
12741274
AggregateValueExpression(I->getNumOperands(), EI->getNumIndices());
12751275
setBasicExpressionInfo(EI, E);
12761276
E->allocateIntOperands(ExpressionAllocator);
1277-
std::copy(EI->idx_begin(), EI->idx_end(), int_op_inserter(E));
1277+
llvm::copy(EI->indices(), int_op_inserter(E));
12781278
return E;
12791279
}
12801280
llvm_unreachable("Unhandled type of aggregate value operation");

0 commit comments

Comments
 (0)