Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2025

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 29, 2025

@llvm/pr-subscribers-platform-windows
@llvm/pr-subscribers-lld-coff
@llvm/pr-subscribers-lld

@llvm/pr-subscribers-lld-macho

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/133565.diff

3 Files Affected:

  • (modified) lld/COFF/Driver.cpp (+1-2)
  • (modified) lld/ELF/Driver.cpp (+1-2)
  • (modified) lld/MachO/Driver.cpp (+1-2)
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();
 }

@kazutakahirata kazutakahirata merged commit 1ff7491 into llvm:main Mar 29, 2025
17 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_set_range_lld branch March 29, 2025 17:29
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 29, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla running on linaro-g4-01 while building lld at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/198/builds/3252

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
...
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/ld64.lld
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/wasm-ld
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/discovery.py:276: warning: input '/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/runtimes/runtimes-bins/compiler-rt/test/interception/Unit' contained no tests
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/discovery.py:276: warning: input '/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/Unit' contained no tests
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/ld.lld
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/lld-link
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/ld64.lld
llvm-lit: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/llvm/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla/stage1/bin/wasm-ld
-- Testing: 96435 tests, 48 workers --
UNRESOLVED: Flang :: Driver/slp-vectorize.ll (1 of 96435)
******************** TEST 'Flang :: Driver/slp-vectorize.ll' FAILED ********************
Test has no 'RUN:' line
********************
PASS: SanitizerCommon-asan-aarch64-Linux :: Linux/pthread_join_invalid.cpp (2 of 96435)
PASS: ThreadSanitizer-aarch64 :: fd_close_norace3.cpp (3 of 96435)
PASS: libFuzzer-aarch64-default-Linux :: sigusr.test (4 of 96435)
PASS: libFuzzer-aarch64-default-Linux :: sigint.test (5 of 96435)
PASS: LLVM :: CodeGen/ARM/build-attributes.ll (6 of 96435)
PASS: LLVM :: MC/Mips/mips-jump-pc-region.s (7 of 96435)
PASS: UBSan-AddressSanitizer-aarch64 :: TestCases/ImplicitConversion/signed-integer-truncation-ignorelist.c (8 of 96435)
PASS: libFuzzer-aarch64-default-Linux :: merge-sigusr.test (9 of 96435)
PASS: Clang :: Driver/cl-options.c (10 of 96435)
PASS: ScudoStandalone-Unit :: ./ScudoUnitTest-aarch64-Test/53/71 (11 of 96435)
PASS: ScudoStandalone-Unit-GwpAsanTorture :: ./ScudoUnitTest-aarch64-Test/53/71 (12 of 96435)
PASS: UBSan-ThreadSanitizer-aarch64 :: TestCases/ImplicitConversion/signed-integer-truncation-ignorelist.c (13 of 96435)
PASS: HWAddressSanitizer-aarch64 :: TestCases/Linux/create-thread-stress.cpp (14 of 96435)
PASS: MemorySanitizer-AARCH64 :: release_origin.c (15 of 96435)
PASS: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir (16 of 96435)
PASS: libFuzzer-aarch64-default-Linux :: msan.test (17 of 96435)
PASS: ThreadSanitizer-aarch64 :: deadlock_detector_stress_test.cpp (18 of 96435)
PASS: Clang :: Driver/linux-ld.c (19 of 96435)
PASS: Clang :: Driver/clang_f_opts.c (20 of 96435)
PASS: Clang :: CodeGen/AArch64/sve-intrinsics/acle_sve_reinterpret-bfloat.c (21 of 96435)
PASS: Clang :: Preprocessor/predefined-arch-macros.c (22 of 96435)
PASS: LLVM :: CodeGen/RISCV/attributes.ll (23 of 96435)
PASS: SanitizerCommon-lsan-aarch64-Linux :: Linux/pthread_join_invalid.cpp (24 of 96435)
PASS: LLVM :: CodeGen/AMDGPU/memintrinsic-unroll.ll (25 of 96435)
PASS: Clang :: Preprocessor/arm-target-features.c (26 of 96435)
PASS: Profile-aarch64 :: Posix/instrprof-value-prof-shared.test (27 of 96435)
PASS: Clang :: Preprocessor/aarch64-target-features.c (28 of 96435)
PASS: libFuzzer-aarch64-default-Linux :: fuzzer-timeout.test (29 of 96435)
PASS: Clang :: Analysis/a_flaky_crash.cpp (30 of 96435)
PASS: ThreadSanitizer-aarch64 :: force_background_thread.cpp (31 of 96435)
PASS: ThreadSanitizer-aarch64 :: signal_thread.cpp (32 of 96435)
PASS: Clang :: Driver/arm-cortex-cpus-1.c (33 of 96435)
PASS: LLVM-Unit :: Support/./SupportTests/26/48 (34 of 96435)
PASS: Clang :: Driver/arm-cortex-cpus-2.c (35 of 96435)
PASS: Clang :: CodeGen/AArch64/sve-intrinsics/acle_sve_reinterpret.c (36 of 96435)
PASS: DataFlowSanitizer-aarch64 :: custom.cpp (37 of 96435)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 29, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla-2stage running on linaro-g4-02 while building lld at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/199/builds/2455

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
...
PASS: Flang :: Driver/predefined-macros-compiler-version.F90 (24739 of 96435)
PASS: Flang :: Driver/include-header.f90 (24740 of 96435)
PASS: Flang :: Driver/phases.f90 (24741 of 96435)
PASS: Flang :: Driver/macro-def-undef.F90 (24742 of 96435)
PASS: Flang :: Driver/print-resource-dir.F90 (24743 of 96435)
PASS: Flang :: Driver/override-triple.ll (24744 of 96435)
PASS: Flang :: Driver/linker-flags.f90 (24745 of 96435)
PASS: Flang :: Driver/parse-fir-error.ll (24746 of 96435)
PASS: Flang :: Driver/parse-error.ll (24747 of 96435)
UNRESOLVED: Flang :: Driver/slp-vectorize.ll (24748 of 96435)
******************** TEST 'Flang :: Driver/slp-vectorize.ll' FAILED ********************
Test has no 'RUN:' line
********************
PASS: Flang :: Driver/missing-arg.f90 (24749 of 96435)
PASS: Flang :: Driver/print-pipeline-passes.f90 (24750 of 96435)
PASS: Flang :: Driver/mlink-builtin-bc.f90 (24751 of 96435)
PASS: Flang :: Driver/parse-ir-error.f95 (24752 of 96435)
PASS: Flang :: Driver/scanning-error.f95 (24753 of 96435)
PASS: Flang :: Driver/pass-plugin-not-found.f90 (24754 of 96435)
PASS: Flang :: Driver/std2018-wrong.f90 (24755 of 96435)
PASS: Flang :: Driver/fixed-line-length.f90 (24756 of 96435)
PASS: Flang :: Driver/print-target-triple.f90 (24757 of 96435)
PASS: Flang :: Driver/pthread.f90 (24758 of 96435)
PASS: Flang :: Driver/mlir-pass-pipeline.f90 (24759 of 96435)
PASS: Flang :: Driver/supported-suffices/f03-suffix.f03 (24760 of 96435)
PASS: Flang :: Driver/pp-fixed-form.f90 (24761 of 96435)
PASS: Flang :: Driver/lto-bc.f90 (24762 of 96435)
PASS: Flang :: Driver/fsave-optimization-record.f90 (24763 of 96435)
PASS: Flang :: Driver/supported-suffices/f08-suffix.f08 (24764 of 96435)
PASS: Flang :: Driver/tco-code-gen-llvm.fir (24765 of 96435)
PASS: Flang :: Driver/target-gpu-features.f90 (24766 of 96435)
PASS: Flang :: Driver/target.f90 (24767 of 96435)
PASS: Flang :: Driver/multiple-input-files.f90 (24768 of 96435)
PASS: Flang :: Driver/unsupported-vscale-max-min.f90 (24769 of 96435)
PASS: Flang :: Driver/q-unused-arguments.f90 (24770 of 96435)
PASS: Flang :: Driver/lto-flags.f90 (24771 of 96435)
PASS: Flang :: Driver/no-duplicate-main.f90 (24772 of 96435)
PASS: Flang :: Driver/unparse-with-modules.f90 (24773 of 96435)
PASS: Flang :: Driver/input-from-stdin/input-from-stdin.f90 (24774 of 96435)
PASS: Flang :: Driver/mllvm.f90 (24775 of 96435)
PASS: Flang :: Driver/optimization-remark-invalid.f90 (24776 of 96435)
PASS: Flang :: Driver/prescanner-diag.f90 (24777 of 96435)
PASS: Flang :: Driver/std2018.f90 (24778 of 96435)
PASS: Flang :: Driver/unparse-use-analyzed.f95 (24779 of 96435)
PASS: Flang :: Driver/target-machine-error.f90 (24780 of 96435)
PASS: Flang :: Driver/save-temps.f90 (24781 of 96435)
PASS: Flang :: Driver/save-temps-use-module.f90 (24782 of 96435)
PASS: Flang :: Driver/optimization-remark-backend.f90 (24783 of 96435)
PASS: Clangd Unit Tests :: ./ClangdTests/73/81 (24784 of 96435)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants