IRGen: Backward-deploy fix using open-coded accessors.

If we mangled an opaque associated type while targeting an older OS, we can use a \9
accessor reference string to instantiate the associated type.
This commit is contained in:
Joe Groff
2019-09-03 19:14:48 -07:00
parent 6817c53031
commit 0ae86c9c9d
9 changed files with 240 additions and 73 deletions

View File

@@ -351,6 +351,8 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(const llvm::Triple &Triple){
if (Major == 10) {
if (Minor <= 14) {
return llvm::VersionTuple(5, 0);
} else if (Minor <= 15) {
return llvm::VersionTuple(5, 1);
} else {
return None;
}
@@ -361,6 +363,8 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(const llvm::Triple &Triple){
Triple.getiOSVersion(Major, Minor, Micro);
if (Major <= 12) {
return llvm::VersionTuple(5, 0);
} else if (Major <= 13) {
return llvm::VersionTuple(5, 1);
} else {
return None;
}
@@ -368,6 +372,8 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(const llvm::Triple &Triple){
Triple.getWatchOSVersion(Major, Minor, Micro);
if (Major <= 5) {
return llvm::VersionTuple(5, 0);
} else if (Major <= 6) {
return llvm::VersionTuple(5, 1);
} else {
return None;
}