[lld] [lld] Add explicit std::move(...) to avoid a few vector copies (PR #180474)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 02:07:24 PST 2026


================
@@ -1339,7 +1339,7 @@ void LinkerDriver::parsePDBAltPath() {
     cursor = secondMark + 1;
   }
 
-  ctx.config.pdbAltPath = buf;
+  ctx.config.pdbAltPath = std::move(buf);
----------------
zmodem wrote:

This only matters if the string is heap allocated, right? I suppose it makes sense for that case.

If we really wanted to, I think this function could parse directly into `ctx.config.pdbAltPath`, and there's not really any need for the `buf` intermediary?

https://github.com/llvm/llvm-project/pull/180474


More information about the llvm-commits mailing list