Author: Jay Foad
Date: 2026-05-07T10:38:17Z
New Revision: bdba997f80242972c9732d51d6a0e65c22d2692d

URL: 
https://github.com/llvm/llvm-project/commit/bdba997f80242972c9732d51d6a0e65c22d2692d
DIFF: 
https://github.com/llvm/llvm-project/commit/bdba997f80242972c9732d51d6a0e65c22d2692d.diff

LOG: [Clang] Avoid some copies in ClangAttrEmitter. NFC. (#193928)

Fixes #94372

Added: 
    

Modified: 
    clang/utils/TableGen/ClangAttrEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/ClangAttrEmitter.cpp 
b/clang/utils/TableGen/ClangAttrEmitter.cpp
index ab7dab77ff6dc..7df99d3beb11a 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -415,9 +415,9 @@ namespace {
     int64_t Default;
 
   public:
-    DefaultSimpleArgument(const Record &Arg, StringRef Attr,
-                          std::string T, int64_t Default)
-      : SimpleArgument(Arg, Attr, T), Default(Default) {}
+    DefaultSimpleArgument(const Record &Arg, StringRef Attr, std::string T,
+                          int64_t Default)
+        : SimpleArgument(Arg, Attr, std::move(T)), Default(Default) {}
 
     void writeAccessors(raw_ostream &OS) const override {
       SimpleArgument::writeAccessors(OS);
@@ -5332,7 +5332,7 @@ class SpellingList {
     return Spellings[(size_t)K];
   }
 
-  void add(const Record &Attr, FlattenedSpelling Spelling) {
+  void add(const Record &Attr, const FlattenedSpelling &Spelling) {
     SpellingKind Kind =
         StringSwitch<SpellingKind>(Spelling.variety())
             .Case("GNU", SpellingKind::GNU)


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to