Skip to content

Revert "[lldb/Platform] Return a std::string from GetSDKPath" #1161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lldb/include/lldb/Target/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,7 @@ class Platform : public PluginInterface {
return lldb_private::ConstString();
}

virtual std::string GetSDKPath(lldb_private::XcodeSDK sdk) {
return {};
}
virtual llvm::StringRef GetSDKPath(lldb_private::XcodeSDK sdk) { return {}; }

const std::string &GetRemoteURL() const { return m_remote_url; }

Expand Down
8 changes: 4 additions & 4 deletions lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1761,12 +1761,12 @@ PlatformDarwin::FindXcodeContentsDirectoryInPath(llvm::StringRef path) {
return {};
}

std::string PlatformDarwin::GetSDKPath(XcodeSDK sdk) {
llvm::StringRef PlatformDarwin::GetSDKPath(XcodeSDK sdk) {
std::lock_guard<std::mutex> guard(m_sdk_path_mutex);
std::string &path = m_sdk_path[sdk.GetString()];
if (!path.empty())
return path;
return HostInfo::GetXcodeSDK(sdk);
if (path.empty())
path = HostInfo::GetXcodeSDK(sdk);
return path;
}

FileSpec PlatformDarwin::GetXcodeContentsDirectory() {
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PlatformDarwin : public PlatformPOSIX {
llvm::Expected<lldb_private::StructuredData::DictionarySP>
FetchExtendedCrashInformation(lldb_private::Process &process) override;

std::string GetSDKPath(lldb_private::XcodeSDK sdk) override;
llvm::StringRef GetSDKPath(lldb_private::XcodeSDK sdk) override;

static lldb_private::FileSpec GetXcodeContentsDirectory();
static lldb_private::FileSpec GetXcodeDeveloperDirectory();
Expand Down