[PATCH] D146694: [NFC] Fix auto usage to avoid copies

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 23:57:00 PDT 2023


LuoYuanke added inline comments.


================
Comment at: llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp:857
     // Insert new location defs.
-    for (auto Pair : BBInsertBeforeMap) {
+    for (auto& Pair : BBInsertBeforeMap) {
       InsertMap &Map = Pair.second;
----------------
I notice in https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable, the example code show "auto &Val". Should we follow the same style "auto &Pair". Ditto for others?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146694/new/

https://reviews.llvm.org/D146694



More information about the llvm-commits mailing list