[llvm] [NFC] Use references to avoid copying (PR #110462)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 01:03:00 PDT 2024


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 a87640c97e5ce5b88304b4149c0e59f4399aff0a 59dcac3296f5daa6424ff8accc8358514e888d4a --extensions cpp -- llvm/utils/TableGen/IntrinsicEmitter.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/utils/TableGen/IntrinsicEmitter.cpp b/llvm/utils/TableGen/IntrinsicEmitter.cpp
index 469d0bbf3a..5ba4091f19 100644
--- a/llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ b/llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -230,7 +230,8 @@ struct IntrinsicTargetInfo {
 static constexpr IntrinsicTargetInfo TargetInfos[] = {
 )";
   for (const auto &Target : Ints.Targets)
-    OS << formatv("  {{\"{}\", {}, {}},\n", Target.Name, Target.Offset, Target.Count);
+    OS << formatv("  {{\"{}\", {}, {}},\n", Target.Name, Target.Offset,
+                  Target.Count);
   OS << R"(};
 #endif
 
@@ -255,7 +256,7 @@ void IntrinsicEmitter::EmitIntrinsicToOverloadTable(
 static constexpr uint8_t OTable[] = {
   0
   )";
-  for (const auto& [I, Int] : enumerate(Ints)) {
+  for (const auto &[I, Int] : enumerate(Ints)) {
     // Add one to the index so we emit a null bit for the invalid #0 intrinsic.
     size_t Idx = I + 1;
 
@@ -345,7 +346,8 @@ static constexpr {} IIT_Table[] = {{
                 FixedEncodingTypeName);
 
   unsigned MaxOffset = 0;
-  for (const auto& [Idx, FixedEncoding, Int] : enumerate(FixedEncodings, Ints)) {
+  for (const auto &[Idx, FixedEncoding, Int] :
+       enumerate(FixedEncodings, Ints)) {
     if ((Idx & 7) == 7)
       OS << "\n  ";
 

``````````

</details>


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


More information about the llvm-commits mailing list