[PATCH] D71219: Fix conflict value for metadata "Objective-C Garbage Collection" in the mix of swift and Objective-C bitcode

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 15:32:51 PST 2020


rjmccall added a comment.

In D71219#1892389 <https://reviews.llvm.org/D71219#1892389>, @steven_wu wrote:

> In D71219#1892292 <https://reviews.llvm.org/D71219#1892292>, @manmanren wrote:
>
> > > We should add a new module flag (with type Error) that contains Major and Minor and make sure "Garbage Collection" value is the same for Swift as for ObjC.
> > > 
> > > In the backend, we will reconstruct IMAGE_INFO from the new module flags and make sure the value stays the same with and without this patch.
> > > 
> > > IMAGE_INFO will be different for Swift vs ObjC.
> >
> > Should be question mark! Meant for clarification from @steven_wu and @rjmccall. Should IMAGE_INFO include the value from the new module flag?
>
>
> Here is my opinion of the best option:
>
> - Break up Garbage Collection field to multiple fields, including swift version, major and minor, and remaining bits (can break down more if needed). All those bits can be set up have the correct type so LTO can link them correctly.
> - Update backend to emit the same IMAGE_INFO by piecing together new module flags.
> - Add a IRUpgrader to upgrade Garbage Collection to new fields.
>
>   IMAGE_INFO is different between swift and objc. For example, in the testcase, Objc has IMAGE_INFO 0x40 and swift has 0x5010700, linker should merge them and produce 0x5010740.


I agree with all of this except that I'm not sure there's any situation where ObjC and Swift translation units should be disagreeing about the ObjC-specific parts of the OBJC_IMAGE_INFO.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71219/new/

https://reviews.llvm.org/D71219





More information about the llvm-commits mailing list