@@ -1006,7 +1006,7 @@ StringRef SwiftASTContext::GetSwiftStdlibOSDir(const llvm::Triple &target,
1006
1006
return target.getOSName ();
1007
1007
}
1008
1008
1009
- StringRef SwiftASTContext::GetResourceDir (const llvm::Triple &triple) {
1009
+ std::string SwiftASTContext::GetResourceDir (const llvm::Triple &triple) {
1010
1010
static std::mutex g_mutex;
1011
1011
std::lock_guard<std::mutex> locker (g_mutex);
1012
1012
StringRef platform_sdk_path = GetPlatformSDKPath ();
@@ -1706,7 +1706,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
1706
1706
}
1707
1707
1708
1708
triple = swift_ast_sp->GetTriple ();
1709
- StringRef resource_dir = swift_ast_sp->GetResourceDir (triple);
1709
+ std::string resource_dir = swift_ast_sp->GetResourceDir (triple);
1710
1710
ConfigureResourceDirs (swift_ast_sp->GetCompilerInvocation (),
1711
1711
FileSpec (resource_dir), triple);
1712
1712
@@ -2014,7 +2014,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(lldb::LanguageType language,
2014
2014
}
2015
2015
2016
2016
llvm::Triple triple = swift_ast_sp->GetTriple ();
2017
- StringRef resource_dir = swift_ast_sp->GetResourceDir (triple);
2017
+ std::string resource_dir = swift_ast_sp->GetResourceDir (triple);
2018
2018
ConfigureResourceDirs (swift_ast_sp->GetCompilerInvocation (),
2019
2019
FileSpec (resource_dir), triple);
2020
2020
@@ -2679,7 +2679,7 @@ void SwiftASTContext::InitializeSearchPathOptions(
2679
2679
}
2680
2680
2681
2681
llvm::Triple triple (GetTriple ());
2682
- StringRef resource_dir = GetResourceDir (triple);
2682
+ std::string resource_dir = GetResourceDir (triple);
2683
2683
ConfigureResourceDirs (GetCompilerInvocation (), FileSpec (resource_dir),
2684
2684
triple);
2685
2685
@@ -3437,7 +3437,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
3437
3437
// Compute the prebuilt module cache path to use:
3438
3438
// <resource-dir>/<platform>/prebuilt-modules
3439
3439
llvm::Triple triple (GetTriple ());
3440
- llvm::SmallString<128 > prebuiltModuleCachePath = GetResourceDir (triple);
3440
+ llvm::SmallString<128 > prebuiltModuleCachePath ( GetResourceDir (triple) );
3441
3441
StringRef platform;
3442
3442
if (swift::tripleIsMacCatalystEnvironment (triple)) {
3443
3443
// The prebuilt cache for macCatalyst is the same as the one for macOS,
0 commit comments