https://github.com/naveen-seth created https://github.com/llvm/llvm-project/pull/161109
This changes the iteration from const to non-const so that std::move results in a true move rather than a copy. >From 73cbb1d0c982dddbd92f63b6dff295a98baf5ddb Mon Sep 17 00:00:00 2001 From: Naveen Seth Hanig <[email protected]> Date: Mon, 29 Sep 2025 01:44:47 +0200 Subject: [PATCH] [clang-scan-deps] Remove const from ModuleDeps loop to enable move. This changes the iteration from const to non-const so that std::move results in a true move rather than a copy. --- clang/tools/clang-scan-deps/ClangScanDeps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp index 0e2758d123edc..e41f4eb7999ae 100644 --- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp +++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp @@ -420,7 +420,7 @@ class FullDeps { std::vector<ModuleDeps *> NewMDs; { std::unique_lock<std::mutex> ul(Lock); - for (const ModuleDeps &MD : Graph) { + for (ModuleDeps &MD : Graph) { auto I = Modules.find({MD.ID, 0}); if (I != Modules.end()) { I->first.InputIndex = std::min(I->first.InputIndex, InputIndex); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
