@@ -233,7 +233,8 @@ TBDGenVisitor::parsePreviousModuleInstallNameMap() {
233
233
}
234
234
235
235
static LinkerPlatformId
236
- getLinkerPlatformId (OriginallyDefinedInAttr::ActiveVersion Ver) {
236
+ getLinkerPlatformId (OriginallyDefinedInAttr::ActiveVersion Ver,
237
+ ASTContext &Ctx) {
237
238
switch (Ver.Platform ) {
238
239
case swift::PlatformKind::none:
239
240
llvm_unreachable (" cannot find platform kind" );
@@ -264,8 +265,9 @@ getLinkerPlatformId(OriginallyDefinedInAttr::ActiveVersion Ver) {
264
265
}
265
266
266
267
static StringRef
267
- getLinkerPlatformName (OriginallyDefinedInAttr::ActiveVersion Ver) {
268
- return getLinkerPlatformName ((uint8_t )getLinkerPlatformId (Ver));
268
+ getLinkerPlatformName (OriginallyDefinedInAttr::ActiveVersion Ver,
269
+ ASTContext &Ctx) {
270
+ return getLinkerPlatformName (getLinkerPlatformId (Ver, Ctx));
269
271
}
270
272
271
273
// / Find the most relevant introducing version of the decl stack we have visited
@@ -313,17 +315,17 @@ void TBDGenVisitor::addLinkerDirectiveSymbolsLdPrevious(
313
315
// so we don't need the linker directives.
314
316
if (*IntroVer >= Ver.Version )
315
317
continue ;
316
- auto PlatformNumber = getLinkerPlatformId (Ver);
318
+ auto PlatformNumber = getLinkerPlatformId (Ver, Ctx );
317
319
auto It = previousInstallNameMap->find (Ver.ModuleName .str ());
318
320
if (It == previousInstallNameMap->end ()) {
319
321
Ctx.Diags .diagnose (SourceLoc (), diag::cannot_find_install_name,
320
- Ver.ModuleName , getLinkerPlatformName (Ver));
322
+ Ver.ModuleName , getLinkerPlatformName (Ver, Ctx ));
321
323
continue ;
322
324
}
323
325
auto InstallName = It->second .getInstallName (PlatformNumber);
324
326
if (InstallName.empty ()) {
325
327
Ctx.Diags .diagnose (SourceLoc (), diag::cannot_find_install_name,
326
- Ver.ModuleName , getLinkerPlatformName (Ver));
328
+ Ver.ModuleName , getLinkerPlatformName (Ver, Ctx ));
327
329
continue ;
328
330
}
329
331
llvm::SmallString<64 > Buffer;
0 commit comments