Similar to cstrings ld64 always deduplicates cfstrings. This was already
being done when enabling ICF, but for debug builds you may want to flip
this on if you cannot eliminate your instances of this, so this change
makes --deduplicate-literals also apply to cfstrings.
Details
- Reviewers
int3 - Group Reviewers
Restricted Project - Commits
- rG15f685eaa886: [lld-macho] Fold cfstrings with --deduplicate-literals
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Here's a repro case where this causes issues https://github.com/tapthaker/lld-reproducer, very similar to the standard cstring cases.
lld/MachO/ICF.cpp | ||
---|---|---|
403 | I'm not happy with hijacking this function for this specific use case, so it would probably make sense for me to try to extract something here |
style fixes, use single new prefix in test
lld/MachO/ICF.cpp | ||
---|---|---|
403 | Ok thanks, we can see how this evolves a bit then I guess | |
lld/test/MachO/cfstring-dedup.s | ||
40–51 | So this part is, but the first CHECK block isn't valid for this codepath, since it expects TEXT,text folding as well. I've combined these to avoid the duplication and pointed the original test to both prefixes, wdyt? |
lld/test/MachO/cfstring-dedup.s | ||
---|---|---|
40–51 | oh right. Yeah, this is a good solution, thanks! |
this is the more typical codebase convention