[PATCH] D134794: [lld-macho] Do not error out on dead stripped duplicate symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 14:35:08 PDT 2022


int3 added inline comments.


================
Comment at: lld/MachO/SymbolTable.cpp:60
+};
+SmallVector<DuplicateSymbolDiag> dupSymReporter;
+} // namespace
----------------
maybe rename this to `dupSymDiags` :)


================
Comment at: lld/MachO/SymbolTable.cpp:97-103
         std::string message =
             "duplicate symbol: " + toString(*defined) + "\n>>> defined in ";
         if (!src1.empty())
           message += src1 + "\n>>>            ";
         message += toString(defined->getFile()) + "\n>>> defined in ";
         if (!src2.empty())
           message += src2 + "\n>>>            ";
----------------
thevinster wrote:
> int3 wrote:
> > could consider moving this into reportPendingDuplicateSymbols -- that way builds that have `--dead-strip-duplicates` won't pay the cost of building these strings
> > 
> > that said the cost is probably trivial, so up to you
> Did a very minor refactor on the struct to be able to move the string building to reportPendingDuplicateSymbols. In particular, I needed to save the src locations and files since accessing the values directly from defined would have been replaced with incorrect values by the time we got to the reporting stage. 
gotcha makes sense


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134794



More information about the llvm-commits mailing list