[clang] [Clang][NFC] Move HeadingAndSpellings to avoid copying (PR #143611)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 10 15:02:42 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

<details>
<summary>Changes</summary>

Static analysis flagged that we could move HeadingAndSpellings and avoid a copy of a large object.

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


1 Files Affected:

- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+1-1) 


``````````diff
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 21d76c12a3cce..42627f02cf356 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -5405,7 +5405,7 @@ void EmitClangAttrDocs(const RecordKeeper &Records, raw_ostream &OS) {
       // Handle Undocumented category separately - no content merging
       if (Cat == "Undocumented" && UndocumentedCategory) {
         UndocumentedDocs.push_back(
-            DocumentationData(Doc, Attr, HeadingAndSpellings));
+            DocumentationData(Doc, Attr, std::move(HeadingAndSpellings)));
         continue;
       }
 

``````````

</details>


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


More information about the cfe-commits mailing list