[clang] clang/utils/TableGen/ClangAttrEmitter.cpp: 2 * pointless copy ? (#94372) (PR #94414)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 16:26:42 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (akshaykumars614)

<details>
<summary>Changes</summary>

modified parameter for code quality

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


1 Files Affected:

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


``````````diff
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index ca7630adfbb7b..fcc3763b00380 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -394,8 +394,8 @@ namespace {
 
   public:
     DefaultSimpleArgument(const Record &Arg, StringRef Attr,
-                          std::string T, int64_t Default)
-      : SimpleArgument(Arg, Attr, T), Default(Default) {}
+                          const std::string &T, int64_t Default)
+        : SimpleArgument(Arg, Attr, T), Default(Default) {}
 
     void writeAccessors(raw_ostream &OS) const override {
       SimpleArgument::writeAccessors(OS);
@@ -4994,7 +4994,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)

``````````

</details>


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


More information about the cfe-commits mailing list