Fix autoupgrade logic for Objective-C class properties module flag
authorMehdi Amini <mehdi.amini@apple.com>
Fri, 16 Sep 2016 00:38:18 +0000 (00:38 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Fri, 16 Sep 2016 00:38:18 +0000 (00:38 +0000)
commitb53b62eb69cd5768423786c5ced700bc2d1d2e20
treecd0b7f050e0efcf5c203a86dc9be0e4ffd253f38
parent1fbaf535d6a4555a751d1285889a7a1f52dfafc5
Fix autoupgrade logic for Objective-C class properties module flag

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.

Differential Revision: https://reviews.llvm.org/D24620

llvm-svn: 281685
llvm/lib/IR/AutoUpgrade.cpp
llvm/test/Bitcode/upgrade-module-flag.ll
llvm/test/Linker/Inputs/objectivec-class-property-flag-mismatch.ll [new file with mode: 0644]
llvm/test/Linker/objectivec-class-property-flag-mismatch.ll [new file with mode: 0644]