Skip to content

Commit c4e9901

Browse files
[llvm] Use llvm::append_range (NFC) (#135931)
1 parent fe94f11 commit c4e9901

File tree

20 files changed

+31
-37
lines changed

20 files changed

+31
-37
lines changed

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,8 +1319,10 @@ class CfiFunctionIndex {
13191319

13201320
std::vector<StringRef> symbols() const {
13211321
std::vector<StringRef> Symbols;
1322-
for (auto &[GUID, Syms] : Index)
1323-
Symbols.insert(Symbols.end(), Syms.begin(), Syms.end());
1322+
for (auto &[GUID, Syms] : Index) {
1323+
(void)GUID;
1324+
llvm::append_range(Symbols, Syms);
1325+
}
13241326
return Symbols;
13251327
}
13261328

llvm/lib/Analysis/MemoryProfileInfo.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ void CallStackTrie::addCallStack(
181181
Curr = New;
182182
}
183183
assert(Curr);
184-
Curr->ContextSizeInfo.insert(Curr->ContextSizeInfo.end(),
185-
ContextSizeInfo.begin(), ContextSizeInfo.end());
184+
llvm::append_range(Curr->ContextSizeInfo, ContextSizeInfo);
186185
}
187186

188187
void CallStackTrie::addCallStack(MDNode *MIB) {
@@ -235,8 +234,7 @@ static MDNode *createMIBNode(LLVMContext &Ctx, ArrayRef<uint64_t> MIBCallStack,
235234

236235
void CallStackTrie::collectContextSizeInfo(
237236
CallStackTrieNode *Node, std::vector<ContextTotalSize> &ContextSizeInfo) {
238-
ContextSizeInfo.insert(ContextSizeInfo.end(), Node->ContextSizeInfo.begin(),
239-
Node->ContextSizeInfo.end());
237+
llvm::append_range(ContextSizeInfo, Node->ContextSizeInfo);
240238
for (auto &Caller : Node->Callers)
241239
collectContextSizeInfo(Caller.second, ContextSizeInfo);
242240
}

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8503,10 +8503,8 @@ void ScalarEvolution::forgetLoop(const Loop *L) {
85038503
}
85048504

85058505
auto LoopUsersItr = LoopUsers.find(CurrL);
8506-
if (LoopUsersItr != LoopUsers.end()) {
8507-
ToForget.insert(ToForget.end(), LoopUsersItr->second.begin(),
8508-
LoopUsersItr->second.end());
8509-
}
8506+
if (LoopUsersItr != LoopUsers.end())
8507+
llvm::append_range(ToForget, LoopUsersItr->second);
85108508

85118509
// Drop information about expressions based on loop-header PHIs.
85128510
PushLoopPHIs(CurrL, Worklist, Visited);

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5098,7 +5098,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
50985098
return;
50995099
for (GlobalValue::GUID GUID : DefOrUseGUIDs) {
51005100
auto Defs = CfiIndex.forGuid(GUID);
5101-
Functions.insert(Functions.end(), Defs.begin(), Defs.end());
5101+
llvm::append_range(Functions, Defs);
51025102
}
51035103
if (Functions.empty())
51045104
return;

llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,7 @@ void DwarfTransformer::parseCallSiteInfoFromDwarf(CUInfo &CUI, DWARFDie Die,
621621
if (!FI.CallSites)
622622
FI.CallSites = CallSiteInfoCollection();
623623
// Append parsed DWARF callsites:
624-
FI.CallSites->CallSites.insert(FI.CallSites->CallSites.end(),
625-
CSIC.CallSites.begin(),
626-
CSIC.CallSites.end());
624+
llvm::append_range(FI.CallSites->CallSites, CSIC.CallSites);
627625
}
628626
}
629627

llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Error LVCompare::execute(LVReader *ReferenceReader, LVReader *TargetReader) {
230230
}
231231
if (Pass == LVComparePass::Added)
232232
// Record all the current missing elements for this category.
233-
Set.insert(Set.end(), Elements.begin(), Elements.end());
233+
llvm::append_range(Set, Elements);
234234
if (options().getReportList()) {
235235
if (Elements.size()) {
236236
OS << "\n(" << Elements.size() << ") "

llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static GenericValue lle_X_fprintf(FunctionType *FT,
485485
char Buffer[10000];
486486
std::vector<GenericValue> NewArgs;
487487
NewArgs.push_back(PTOGV(Buffer));
488-
NewArgs.insert(NewArgs.end(), Args.begin()+1, Args.end());
488+
llvm::append_range(NewArgs, llvm::drop_begin(Args));
489489
GenericValue GV = lle_X_sprintf(FT, NewArgs);
490490

491491
fputs(Buffer, (FILE *) GVTOP(Args[0]));

llvm/lib/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void VTuneSupportPlugin::notifyTransferringResources(JITDylib &JD,
162162
return;
163163

164164
auto &Dest = LoadedMethodIDs[DstKey];
165-
Dest.insert(Dest.end(), I->second.begin(), I->second.end());
165+
llvm::append_range(Dest, I->second);
166166
LoadedMethodIDs.erase(SrcKey);
167167
}
168168

llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void LazyReexportsManager::handleTransferResources(JITDylib &JD,
323323
} else {
324324
auto &SrcAddrs = I->second;
325325
auto &DstAddrs = J->second;
326-
DstAddrs.insert(DstAddrs.end(), SrcAddrs.begin(), SrcAddrs.end());
326+
llvm::append_range(DstAddrs, SrcAddrs);
327327
KeyToReentryAddrs.erase(I);
328328
}
329329
if (L)
@@ -503,7 +503,7 @@ void SimpleLazyReexportsSpeculator::onLazyReexportsTransfered(
503503
} else {
504504
auto &SrcNames = J->second;
505505
auto &DstNames = K->second;
506-
DstNames.insert(DstNames.end(), SrcNames.begin(), SrcNames.end());
506+
llvm::append_range(DstNames, SrcNames);
507507
MapForJD.erase(J);
508508
}
509509
}

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ DIExpression *DIExpression::appendOpsToArg(const DIExpression *Expr,
19901990
}
19911991
Op.appendToVector(NewOps);
19921992
if (Op.getOp() == dwarf::DW_OP_LLVM_arg && Op.getArg(0) == ArgNo)
1993-
NewOps.insert(NewOps.end(), Ops.begin(), Ops.end());
1993+
llvm::append_range(NewOps, Ops);
19941994
}
19951995
if (StackValue)
19961996
NewOps.push_back(dwarf::DW_OP_stack_value);

0 commit comments

Comments
 (0)