[lldb][NFCI] Platforms should own their SDKBuild and SDKRootDirectory strings

These don't need to be ConstStrings. They don't really benefit much from
deduplication and comparing them isn't on a hot path, so they don't
really benefit much from quick comparisons.

Differential Revision: https://reviews.llvm.org/D152331
This commit is contained in:
Alex Langford
2023-06-06 18:48:31 -07:00
parent 7f26c27e03
commit f4be9ff645
7 changed files with 59 additions and 56 deletions

View File

@@ -210,11 +210,10 @@ Status Platform::GetSharedModule(
Status error(eErrorTypeGeneric);
ModuleSpec resolved_spec;
// Check if we have sysroot set.
if (m_sdk_sysroot) {
if (!m_sdk_sysroot.empty()) {
// Prepend sysroot to module spec.
resolved_spec = spec;
resolved_spec.GetFileSpec().PrependPathComponent(
m_sdk_sysroot.GetStringRef());
resolved_spec.GetFileSpec().PrependPathComponent(m_sdk_sysroot);
// Try to get shared module with resolved spec.
error = ModuleList::GetSharedModule(resolved_spec, module_sp,
module_search_paths_ptr, old_modules,
@@ -312,9 +311,9 @@ void Platform::GetStatus(Stream &strm) {
strm.Printf(" Connected: %s\n", is_connected ? "yes" : "no");
}
if (GetSDKRootDirectory()) {
strm.Format(" Sysroot: {0}\n", GetSDKRootDirectory());
}
if (const std::string &sdk_root = GetSDKRootDirectory(); !sdk_root.empty())
strm.Format(" Sysroot: {0}\n", sdk_root);
if (GetWorkingDirectory()) {
strm.Printf("WorkingDir: %s\n", GetWorkingDirectory().GetPath().c_str());
}