summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-09-16 00:38:18 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-09-16 00:38:18 +0000
commitb53b62eb69cd5768423786c5ced700bc2d1d2e20 (patch)
treecd0b7f050e0efcf5c203a86dc9be0e4ffd253f38 /llvm/lib
parent1fbaf535d6a4555a751d1285889a7a1f52dfafc5 (diff)
downloadbcm5719-llvm-b53b62eb69cd5768423786c5ced700bc2d1d2e20.tar.gz
bcm5719-llvm-b53b62eb69cd5768423786c5ced700bc2d1d2e20.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index a68247be973..8a5170fb631 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1587,11 +1587,11 @@ bool llvm::UpgradeModuleFlags(Module &M) {
}
// "Objective-C Class Properties" is recently added for Objective-C. We
// upgrade ObjC bitcodes to contain a "Objective-C Class Properties" module
- // flag of value 0, so we can correclty report error when trying to link
- // an ObjC bitcode without this module flag with an ObjC bitcode with this
- // module flag.
+ // flag of value 0, so we can correclty downgrade this flag when trying to
+ // link an ObjC bitcode without this module flag with an ObjC bitcode with
+ // this module flag.
if (HasObjCFlag && !HasClassProperties) {
- M.addModuleFlag(llvm::Module::Error, "Objective-C Class Properties",
+ M.addModuleFlag(llvm::Module::Override, "Objective-C Class Properties",
(uint32_t)0);
return true;
}
OpenPOWER on IntegriCloud