[PATCH] D142916: [lld-macho] Warn on method name collisions from category definitions

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 05:57:11 PST 2023


oontvoo accepted this revision.
oontvoo added a comment.

Thanks!



================
Comment at: lld/MachO/Driver.cpp:1918
 
+    objc::checkCategories();
+
----------------
maybe conditioned this under `-ObjC` ? (i mean, no reason to do the checks, walking thru lots of isecs if we know there's no objc code?)


================
Comment at: lld/MachO/ObjC.cpp:284-290
+  for (const InputSection *isec : inputSections) {
+    if (isec->getName() == section_names::objcCatList)
+      for (const Reloc &r : isec->relocs) {
+        auto *catIsec = cast<ConcatInputSection>(r.getReferentInputSection());
+        checker.parseCategory(catIsec);
+      }
+  }
----------------
int3 wrote:
> thevinster wrote:
> > Benchmarks don't show a huge regression, but would it better to parallelize this loop? The only downside I see is warning diagnostics being indeterministic, but that might be a blocker for others. 
> I want to wait till the category merging itself is implemented before attempting parallelization
> 
> I might also just delay landing this for a while
We'd love to have this check asap =) 

(This should fix https://github.com/llvm/llvm-project/issues/54912)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142916



More information about the llvm-commits mailing list