mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -2300,6 +2300,22 @@ IRGenModule *IRGenerator::getGenModule(SILFunction *f) {
|
||||
return getPrimaryIGM();
|
||||
}
|
||||
|
||||
IRGenModule *IRGenerator::getGenModule(SILGlobalVariable *v) {
|
||||
if (GenModules.size() == 1) {
|
||||
return getPrimaryIGM();
|
||||
}
|
||||
|
||||
auto found = DefaultIGMForGlobalVariable.find(v);
|
||||
if (found != DefaultIGMForGlobalVariable.end())
|
||||
return found->second;
|
||||
|
||||
if (auto decl = v->getDecl()) {
|
||||
return getGenModule(decl->getDeclContext());
|
||||
}
|
||||
|
||||
return getPrimaryIGM();
|
||||
}
|
||||
|
||||
uint32_t swift::irgen::getSwiftABIVersion() {
|
||||
return IRGenModule::swiftVersion;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user