[PATCH] D113130: [llvm-libtool-darwin] Print a warning if object file names are repeated

Roger Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 15:47:42 PST 2021


Roger added inline comments.


================
Comment at: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp:488-490
+  for (const auto &M : MembersPerArch) {
+    const auto &Members = M.second.getMembers();
+    const auto &Files = M.second.getFiles();
----------------
jhenderson wrote:
> I'd prefer not to use `auto` here. In fact, for `Members` and `Files`, I believe you could (should?) be using `ArrayRef<>`
Done.


================
Comment at: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp:491
+    const auto &Files = M.second.getFiles();
+    std::map<StringRef, std::vector<StringRef>> MembersToFiles;
+    for (auto iterators = std::make_pair(Members.cbegin(), Files.cbegin());
----------------
jhenderson wrote:
> Is there a reason this is a) ordered and b) using a `std::map` rather than LLVM's `StringMap`?
You're right I shouldn't use an ordered map. I didn't know about StringMap (am very new to the LLVM codebase). I'll use it :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113130



More information about the llvm-commits mailing list