[PATCH] D71219: Fix conflict value for metadata "Objective-C Garbage Collection" in the mix of swift and Objective-C bitcode
Steven Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 26 09:03:08 PST 2020
steven_wu added a comment.
>> The 0x40 bit is actually OBJC_IMAGE_HAS_CATEGORY_CLASS_PROPERTIES, which probably can differ from translation unit to translation unit even within ObjC. Some of the other bits should not be different. That is why I say you can break the bits down even more if needed.
>
> Clang seems to set it unconditionally. Presumably it just controls whether category descriptors have a class-properties field; offhand, I don't know why that would need to be set globally.
Does swift set this bit unconditionally? If so, then there is probably no reason for the lower bits to be different.
@jinlin Let me be more specific about what I suggest:
- clang can keep "Objective-C Garbage Collection" metadata but its value should be i8 instead of i32. The type of the module flag should be Error.
- swift compiler will emit "Objective-C Garbage Collection" together with swift ABI version, major and minor. All of them should be Error type.
- backend should know how to generate IMAGE_INFO from `Swift ABI version + major + minor + "Objective-C Garbage Collection"`
- IRUpgrader should turn a i32 type "Objective-C Garbage Collection" into i8 value, if the higher bits are set, it adds the module flag for swift info.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71219/new/
https://reviews.llvm.org/D71219
More information about the llvm-commits
mailing list