Merge pull request #41476 from ahoppen/pr/store-path-in-modulesearchpath

[Serialization] Store the path inside ModuleSearchPath as a string, not a StringRef
This commit is contained in:
Alex Hoppen
2022-02-22 16:57:33 +01:00
committed by GitHub
3 changed files with 39 additions and 17 deletions

View File

@@ -608,10 +608,10 @@ SerializedModuleLoaderBase::findModule(ImportPath::Element moduleID,
InterestingFilenames, Ctx.SourceMgr.getFileSystem().get(),
Ctx.LangOpts.Target.isOSDarwin());
for (const auto &searchPath : searchPaths) {
currPath = searchPath->Path;
isSystemModule = searchPath->IsSystem;
currPath = searchPath->getPath();
isSystemModule = searchPath->isSystem();
switch (searchPath->Kind) {
switch (searchPath->getKind()) {
case ModuleSearchPathKind::Import:
case ModuleSearchPathKind::RuntimeLibrary: {
isFramework = false;
@@ -621,7 +621,7 @@ SerializedModuleLoaderBase::findModule(ImportPath::Element moduleID,
// This was not always true on non-Apple platforms, and in order to
// ease the transition, check both layouts.
bool checkTargetSpecificModule = true;
if (searchPath->Kind != ModuleSearchPathKind::RuntimeLibrary ||
if (searchPath->getKind() != ModuleSearchPathKind::RuntimeLibrary ||
!Ctx.LangOpts.Target.isOSDarwin()) {
auto modulePath = currPath;
llvm::sys::path::append(modulePath, genericModuleFileName);