[all-commits] [llvm/llvm-project] e97bd0: [lld-macho] Category Merging: Detect correct class...
alx32 via All-commits
all-commits at lists.llvm.org
Mon Jul 8 14:11:12 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e97bd0300b57547774c5cfe6fe84ebd0efc421ec
https://github.com/llvm/llvm-project/commit/e97bd0300b57547774c5cfe6fe84ebd0efc421ec
Author: alx32 <103613512+alx32 at users.noreply.github.com>
Date: 2024-07-08 (Mon, 08 Jul 2024)
Changed paths:
M lld/MachO/ObjC.cpp
A lld/test/MachO/objc-category-merging-swift-class-ext.s
Log Message:
-----------
[lld-macho] Category Merging: Detect correct class language for classes with aliased symbols (#97454)
Currently we rely on detecting the source language of a class by the
name of the symbol pointing to it. This generally works, but there are
scenarios where Swift generates both an ObjC name and a Swift name for
the symbol - by aliasing the ObjC name to the Swift name, as follows:
```
.globl _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass
.private_extern _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass
.set _OBJC_CLASS_$__TtC11MyTestClass11MyTestClass, _$s11MyTestClassAACN
```
So to correctly detect the source language in all cases, we need to
handle scenarios where both an ObjC symbol and a Swift symbol is defined
for a class - in this case the symbol is always a Swift class.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list