[PATCH] D52051: [LLD] [COFF] Avoid copying of chunk vectors. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 15:41:31 PDT 2018


ruiu added inline comments.


================
Comment at: COFF/Writer.cpp:472
   // contributes to .text, for example. See PE/COFF spec 3.2.
-  for (auto Pair : Map) {
+  for (auto &Pair : Map) {
     StringRef Name = getOutputSectionName(Pair.first.first);
----------------
smeenai wrote:
> Could this be `const`?
In lld we don't normally sprinkle `const` if it is obviously not mutated. I prefer keeping variable scope as narrow as possible rather than adding `const` in general.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D52051





More information about the llvm-commits mailing list