[lld] [lld] Use *Set::insert_range (NFC) (PR #133565)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 28 21:09:52 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133565
None
>From f171db2416cfa296d55523a217c45bf9420403d6 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 28 Mar 2025 20:56:13 -0700
Subject: [PATCH] [lld] Use *Set::insert_range (NFC)
---
lld/COFF/Driver.cpp | 3 +--
lld/ELF/Driver.cpp | 3 +--
lld/MachO/Driver.cpp | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index bb64a5c0b9e96..9bbab524b1f9a 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -1977,8 +1977,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
// Handle /lldsavetemps
if (args.hasArg(OPT_lldsavetemps)) {
- for (const char *s : lldsaveTempsValues)
- config->saveTempsArgs.insert(s);
+ config->saveTempsArgs.insert_range(lldsaveTempsValues);
} else {
for (auto *arg : args.filtered(OPT_lldsavetemps_colon)) {
StringRef s = arg->getValue();
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 7267171635e17..0a220432333cc 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1467,8 +1467,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
if (args.hasArg(OPT_save_temps)) {
// --save-temps implies saving all temps.
- for (const char *s : saveTempsValues)
- ctx.arg.saveTempsArgs.insert(s);
+ ctx.arg.saveTempsArgs.insert_range(saveTempsValues);
} else {
for (auto *arg : args.filtered(OPT_save_temps_eq)) {
StringRef s = arg->getValue();
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 7070e92ddc4a1..bec94f830e976 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -616,8 +616,7 @@ static bool compileBitcodeFiles() {
lto->add(*bitcodeFile);
std::vector<ObjFile *> compiled = lto->compile();
- for (ObjFile *file : compiled)
- inputFiles.insert(file);
+ inputFiles.insert_range(compiled);
return !compiled.empty();
}
More information about the llvm-commits
mailing list