This is an archive of the discontinued LLVM Phabricator instance.

Fix autoupgrade logic for Objective-C class properties module flag
ClosedPublic

Authored by mehdi_amini on Sep 15 2016, 12:56 PM.

Details

Summary

Previous we were issuing an error when linking a module containing
the new Objective-C metadata structure for class properties with an
"old" one.
Now instead we downgrade the module flag so that the Objective-C
runtime does not expect the new metadata structure.

This is consistent with what ld64 is doing on binary files.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to Fix autoupgrade logic for Objective-C class properties module flag.
mehdi_amini updated this object.
mehdi_amini added reviewers: dexonsmith, manmanren.
mehdi_amini added a subscriber: llvm-commits.
manmanren edited edge metadata.Sep 15 2016, 1:50 PM

Thanks for working on this!

This makes sense. I wonder what happens when we downgrade. Will the class properties in the new code no longer functional?

Manman

llvm/lib/IR/AutoUpgrade.cpp
1566 ↗(On Diff #71538)

Please update the comment.

Greg told me that only the metadata that contains the description of the properties won't be available.
Note that ld64 issue a warning when we do the same with MachO object file, but there is no easy way to do it for LTO, we may add it afterward.

manmanren accepted this revision.Sep 15 2016, 3:16 PM
manmanren edited edge metadata.

LGTM. Please update the comment.

Cheers,
Manman

This revision is now accepted and ready to land.Sep 15 2016, 3:16 PM
This revision was automatically updated to reflect the committed changes.