Merge remote-tracking branch 'origin/main' into rebranch

This commit is contained in:
swift-ci
2024-07-03 18:14:58 -07:00
9 changed files with 134 additions and 27 deletions

View File

@@ -93,19 +93,6 @@ static bool isTargetTooNew(const llvm::Triple &moduleTarget,
return ctxTarget.isOSVersionLT(moduleTarget);
}
std::string ModuleFile::resolveModuleDefiningFilename(const ASTContext &ctx) {
if (!Core->ModuleInterfacePath.empty()) {
std::string interfacePath = Core->ModuleInterfacePath.str();
if (llvm::sys::path::is_relative(interfacePath)) {
SmallString<128> absoluteInterfacePath(ctx.SearchPathOpts.getSDKPath());
llvm::sys::path::append(absoluteInterfacePath, interfacePath);
return absoluteInterfacePath.str().str();
} else
return interfacePath;
} else
return getModuleLoadedFilename().str();
}
namespace swift {
namespace serialization {
bool areCompatible(const llvm::Triple &moduleTarget,
@@ -273,7 +260,8 @@ Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc,
ASTContext &ctx = getContext();
// Resolve potentially-SDK-relative module-defining .swiftinterface path
ResolvedModuleDefiningFilename = resolveModuleDefiningFilename(ctx);
ResolvedModuleDefiningFilename =
Core->resolveModuleDefiningFilePath(ctx.SearchPathOpts.getSDKPath());
llvm::Triple moduleTarget(llvm::Triple::normalize(Core->TargetTriple));
if (!areCompatible(moduleTarget, ctx.LangOpts.Target)) {