mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: get metadata symbol of class __StaticArrayStorage the correct way
Fixes an unresolved symbol error when building the stdlib on some platforms. rdar://119991570
This commit is contained in:
@@ -2046,8 +2046,23 @@ bool IRGenModule::canMakeStaticObjectsReadOnly() {
|
||||
if (!Triple.isOSDarwin())
|
||||
return false;
|
||||
|
||||
return getAvailabilityContext().isContainedIn(
|
||||
Context.getStaticReadOnlyArraysAvailability());
|
||||
if (!getAvailabilityContext().isContainedIn(Context.getStaticReadOnlyArraysAvailability()))
|
||||
return false;
|
||||
|
||||
if (!getStaticArrayStorageDecl())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ClassDecl *IRGenModule::getStaticArrayStorageDecl() {
|
||||
SmallVector<ValueDecl *, 1> results;
|
||||
Context.lookupInSwiftModule("__StaticArrayStorage", results);
|
||||
|
||||
if (results.size() != 1)
|
||||
return nullptr;
|
||||
|
||||
return dyn_cast<ClassDecl>(results[0]);
|
||||
}
|
||||
|
||||
void IRGenerator::addGenModule(SourceFile *SF, IRGenModule *IGM) {
|
||||
|
||||
Reference in New Issue
Block a user