[lld] [lld-macho][ObjC] Implement category merging into base class (PR #92448)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 22:48:04 PDT 2024
================
@@ -1265,10 +1297,16 @@ void ObjcCategoryMerger::removeRefsToErasedIsecs() {
void ObjcCategoryMerger::doMerge() {
collectAndValidateCategoriesData();
- for (auto &entry : categoryMap)
- if (entry.second.size() > 1)
+ for (auto &entry : categoryMap) {
+ if (isa<Defined>(entry.first)) {
+ // Merge all categories into the base class
+ auto *baseClass = cast<Defined>(entry.first);
+ mergeCategoriesIntoBaseClass(baseClass, entry.second);
+ } else if (entry.second.size() > 1) {
----------------
alx32 wrote:
`for (auto &[sym, cats]: categoryMap)` works - very nice !
https://github.com/llvm/llvm-project/pull/92448
More information about the llvm-commits
mailing list