[lld] 1ff7491 - [lld] Use *Set::insert_range (NFC) (#133565)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 29 10:29:49 PDT 2025


Author: Kazu Hirata
Date: 2025-03-29T10:29:45-07:00
New Revision: 1ff74917b56e9e57dd13286123144b5f13e9a517

URL: https://github.com/llvm/llvm-project/commit/1ff74917b56e9e57dd13286123144b5f13e9a517
DIFF: https://github.com/llvm/llvm-project/commit/1ff74917b56e9e57dd13286123144b5f13e9a517.diff

LOG: [lld] Use *Set::insert_range (NFC) (#133565)

Added: 
    

Modified: 
    lld/COFF/Driver.cpp
    lld/ELF/Driver.cpp
    lld/MachO/Driver.cpp

Removed: 
    


################################################################################
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