[lld] [lld-macho] Add swift support to ObjC category merger (PR #95124)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 07:35:59 PDT 2024


================
@@ -1270,7 +1274,9 @@ void ObjcCategoryMerger::eraseMergedCategories() {
 
       eraseISec(catInfo.catBodyIsec);
 
-      tryEraseDefinedAtIsecOffset(catInfo.catBodyIsec, catLayout.nameOffset);
+      // We can't erase 'catLayout.nameOffset' because for Swift categories, the
+      // name will be referenced in __METACLASS_DATA_.
+      // TODO: handle the above smarter
----------------
alx32 wrote:

I will address this in a follow-up PR with a test that includes `__METACLASS_DATA_`. 

https://github.com/llvm/llvm-project/pull/95124


More information about the llvm-commits mailing list