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/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 19df34d..0a0314d 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -823,7 +823,8 @@
if (!omvn_initializer_array->isString())
return false;
- std::string omvn_initializer_string = omvn_initializer_array->getAsString();
+ std::string omvn_initializer_string =
+ std::string(omvn_initializer_array->getAsString());
LLDB_LOG(log, "Found Objective-C selector reference \"{0}\"",
omvn_initializer_string);
@@ -981,7 +982,8 @@
if (!ocn_initializer_array->isString())
return false;
- std::string ocn_initializer_string = ocn_initializer_array->getAsString();
+ std::string ocn_initializer_string =
+ std::string(ocn_initializer_array->getAsString());
LLDB_LOG(log, "Found Objective-C class reference \"{0}\"",
ocn_initializer_string);