[llvm] fixed #95641 pointless string copy (PR #127325)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 08:06:18 PST 2025


================
@@ -1966,9 +1966,7 @@ class RecordKeeper {
     return It == ExtraGlobals.end() ? nullptr : It->second;
   }
 
-  void saveInputFilename(std::string Filename) {
-    InputFilename = Filename;
-  }
+  void saveInputFilename(std::string &&Filename) { InputFilename = Filename; }
----------------
sommersun wrote:

ok, both use 
`void saveInputFilename(std::string &&Filename) { InputFilename = std::move(Filename); }`

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


More information about the llvm-commits mailing list