[llvm] [Offload][NFCI] Avoid temporary string copies in InfoTreeNode (PR #159372)

Alexey Sachkov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 03:04:31 PDT 2025


================
@@ -192,17 +192,16 @@ struct InfoTreeNode {
   llvm::DenseMap<DeviceInfo, size_t> DeviceInfoMap;
 
   InfoTreeNode() : InfoTreeNode("", std::monostate{}, "") {}
-  InfoTreeNode(std::string Key, VariantType Value, std::string Units)
-      : Key(Key), Value(Value), Units(Units) {}
+  InfoTreeNode(std::string &&Key, VariantType Value, std::string &&Units)
----------------
AlexeySachkov wrote:

If I understood it correctly, the concern should be resolved in 663d2e129a3cf681c554a311ac03d7b816fe0db4

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


More information about the llvm-commits mailing list