[PATCH] D123252: [lld/mac] Don't emit stabs entries for functions folded during ICF
    Jez Ng via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Apr  7 05:11:45 PDT 2022
    
    
  
int3 added inline comments.
Herald added a subscriber: ormris.
================
Comment at: lld/MachO/Symbols.cpp:103
+      isec = canonical;
+      wasIdenticalCodeFolded = true;
+    }
----------------
thakis wrote:
> thakis wrote:
> > int3 wrote:
> > > How do you feel about doing this work in `ConcatInputSection::foldIdentical` instead? We already toggle `ConcatInputSection::wasCoalesced` there, so this would fit in nicely.
> > > 
> > > (We could also perform the canonicalization of `Defined::isec` there -- I'd previously put it here because InputSections didn't use to hold references to their symbols.)
> > Do you mean giving ConcatInputSection a bool for this and setting that bool instead of giving Defined a bit, and then querying `defined->isec->wasIdenticalCodeFolded` instead of `defined->wasIdenticalCodeFolded`? Or do you mean keeping the bit on Defined and make `ConcatInputSection::foldIdentical` walk `symbols` and set the bit on all the section's symbols?
> Oh wait the former doesn't work, `defined->isec` is the canonical section.
> 
> So did the latter. LMK if that's not what you meant :)
I did mean the latter, but you got me pondering whether the former would work for a second :p
lgtm, thanks!
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123252/new/
https://reviews.llvm.org/D123252
    
    
More information about the llvm-commits
mailing list