0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-21 19:57:00 +00:00

[lld] Use *Set::insert_range (NFC) ()

DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch replaces:

  Dest.insert(Src.begin(), Src.end());

with:

  Dest.insert_range(Src);
This commit is contained in:
Kazu Hirata 2025-03-22 21:57:06 -07:00 committed by GitHub
parent 441c9a9273
commit 00cb966209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

@ -797,7 +797,7 @@ void LinkerScript::processSectionCommands() {
if (!potentialSpillLists.empty()) {
DenseSet<StringRef> insertNames;
for (InsertCommand &ic : insertCommands)
insertNames.insert(ic.names.begin(), ic.names.end());
insertNames.insert_range(ic.names);
for (SectionCommand *&base : sectionCommands) {
auto *osd = dyn_cast<OutputDesc>(base);
if (!osd)

@ -588,7 +588,7 @@ void Writer::populateTargetFeatures() {
if (ctx.arg.extraFeatures.has_value()) {
auto &extraFeatures = *ctx.arg.extraFeatures;
allowed.insert(extraFeatures.begin(), extraFeatures.end());
allowed.insert_range(extraFeatures);
}
// Only infer used features if user did not specify features
@ -596,7 +596,7 @@ void Writer::populateTargetFeatures() {
if (!inferFeatures) {
auto &explicitFeatures = *ctx.arg.features;
allowed.insert(explicitFeatures.begin(), explicitFeatures.end());
allowed.insert_range(explicitFeatures);
if (!ctx.arg.checkFeatures)
goto done;
}