[llvm] fixed #95641 pointless string copy (PR #127325)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 16 06:52:39 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff b6be53d4cb92592940618555ba5fbf412c0cfca8 4230d2138933eedb12ed1e9c8eec8e48ee106bed --extensions cpp,h -- llvm/include/llvm/TableGen/Record.h llvm/lib/TableGen/Main.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index 08d8e2a94c..e7fe9ab552 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -142,7 +142,6 @@ public:
 
   unsigned getNumBits() const { return Size; }
 
-
   std::string getAsString() const override;
 
   bool typeIsConvertibleTo(const RecTy *RHS) const override;
@@ -1967,9 +1966,7 @@ public:
     return It == ExtraGlobals.end() ? nullptr : It->second;
   }
 
-  void saveInputFilename(std::string && Filename) {
-    InputFilename = Filename;
-  }
+  void saveInputFilename(std::string &&Filename) { InputFilename = Filename; }
 
   void addClass(std::unique_ptr<Record> R) {
     bool Ins =

``````````

</details>


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


More information about the llvm-commits mailing list