Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.
This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.
This doesn't actually modify StringRef yet, I'll do that in a follow-up.
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 1563279..a9e674e 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -481,8 +481,8 @@
info_dict->HasKey("shared_cache_base_address")) {
base_address = info_dict->GetValueForKey("shared_cache_base_address")
->GetIntegerValue(LLDB_INVALID_ADDRESS);
- std::string uuid_str =
- info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue();
+ std::string uuid_str = std::string(
+ info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue());
if (!uuid_str.empty())
uuid.SetFromStringRef(uuid_str);
if (!info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue())