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

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 04:22:23 PDT 2024


================
@@ -229,8 +229,9 @@ struct IntrinsicTargetInfo {
 };
 static constexpr IntrinsicTargetInfo TargetInfos[] = {
 )";
-  for (const auto [Name, Offset, Count] : Ints.Targets)
-    OS << formatv("  {{\"{}\", {}, {}},\n", Name, Offset, Count);
+  for (const auto &Target : Ints.Targets)
----------------
phoebewang wrote:

I recall references is not good for small value, maybe ignore them and just remove the `const`?

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


More information about the llvm-commits mailing list