[PATCH] D70870: [IR] Use a reference in a range-based for

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 1 03:17:04 PST 2019


fhahn added inline comments.


================
Comment at: llvm/lib/IR/Attributes.cpp:728
 
-  for (const auto I : *this) {
+  for (const auto &I : *this) {
     if (!I.isStringAttribute()) {
----------------
It might help a bit more with readability of the code (here and other places in the patch) if you expand the type instead of auto, if the type is not too long (https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70870





More information about the llvm-commits mailing list