mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[metadata prespecialization] Target only >=5.2.
Compatibility with earlier swift runtimes would require modifying the runtime compatibility libraries to adjust the behavior of checkMetadataState by way of typeForMangledNode or even typeForMangledName. For now, simply require that a version of swift whose runtime knows about prespecialized metadata is being targeted.
This commit is contained in:
@@ -1329,6 +1329,15 @@ void IRGenModule::error(SourceLoc loc, const Twine &message) {
|
||||
|
||||
bool IRGenModule::useDllStorage() { return ::useDllStorage(Triple); }
|
||||
|
||||
bool IRGenModule::shouldPrespecializeGenericMetadata() {
|
||||
auto &context = getSwiftModule()->getASTContext();
|
||||
auto deploymentAvailability =
|
||||
AvailabilityContext::forDeploymentTarget(context);
|
||||
return IRGen.Opts.PrespecializeGenericMetadata &&
|
||||
deploymentAvailability.isContainedIn(
|
||||
context.getPrespecializedGenericMetadataAvailability());
|
||||
}
|
||||
|
||||
void IRGenerator::addGenModule(SourceFile *SF, IRGenModule *IGM) {
|
||||
assert(GenModules.count(SF) == 0);
|
||||
GenModules[SF] = IGM;
|
||||
|
||||
Reference in New Issue
Block a user