[clang] [clang] MangledSymbol: remove pointless copy of vector (PR #90012)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 19:54:39 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Andrew Sukach (soukatch)

<details>
<summary>Changes</summary>

This pr addresses #<!-- -->87255 adds a std::move call to the names in MangledSymbol's constructor.

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


1 Files Affected:

- (modified) clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp (+2-1) 


``````````diff
diff --git a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
index d58f5bb0919906..81a827dba26b90 100644
--- a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
+++ b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
@@ -33,7 +33,8 @@ class InterfaceStubFunctionsConsumer : public ASTConsumer {
 
     MangledSymbol(const std::string &ParentName, uint8_t Type, uint8_t Binding,
                   std::vector<std::string> Names)
-        : ParentName(ParentName), Type(Type), Binding(Binding), Names(Names) {}
+        : ParentName(ParentName), Type(Type), Binding(Binding),
+          Names(std::move(Names)) {}
   };
   using MangledSymbols = std::map<const NamedDecl *, MangledSymbol>;
 

``````````

</details>


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


More information about the cfe-commits mailing list