[PATCH] D85501: [lld-macho] Handle command-line option -sectcreate SEG SECT FILE

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 12:16:42 PDT 2020


int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:313
+  isec->data = {buf, mb.getBufferSize()};
+  subsections.push_back({{0, isec}});
+}
----------------
gkm wrote:
> int3 wrote:
> > nit: `subsections.emplace_back({0, isec});`
> I followed prior practice in `InputFile::parseSections`. If I follow your recommendation, it seems I should also fix `InputFile::parseSections`, but then I am straying from the purpose of this diff into cleanup territory. Perhaps we should rather save cleanups for a separate diff, which could also include explicit `const auto`.
I think it's worthwhile to make new code conform to the linter. That way, even if we don't explicitly do cleanups, we will still organically move to the new convention in the course of normal code churn from development. But I'm fine with migrating to `emplace` in a separate diff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85501



More information about the llvm-commits mailing list