[clang] [Clang][NFC] Move HeadingAndSpellings to avoid copying (PR #143611)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 15:02:09 PDT 2025
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/143611
Static analysis flagged that we could move HeadingAndSpellings and avoid a copy of a large object.
>From 55d520891a09e3cd3ef85eeba501ad80d8240619 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Tue, 10 Jun 2025 14:59:57 -0700
Subject: [PATCH] [Clang][NFC] Move HeadingAndSpellings to avoid copying
Static analysis flagged that we could move HeadingAndSpellings and avoid a copy
of a large object.
---
clang/utils/TableGen/ClangAttrEmitter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
More information about the cfe-commits
mailing list