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/Utility/Status.cpp b/lldb/source/Utility/Status.cpp
index 5eabffc..c8ca485 100644
--- a/lldb/source/Utility/Status.cpp
+++ b/lldb/source/Utility/Status.cpp
@@ -241,7 +241,7 @@
if (Success())
SetErrorToGenericError();
}
- m_string = err_str;
+ m_string = std::string(err_str);
}
/// Set the current error string to a formatted error string.
@@ -270,7 +270,7 @@
llvm::SmallString<1024> buf;
VASprintf(buf, format, args);
- m_string = buf.str();
+ m_string = std::string(buf.str());
return buf.size();
} else {
m_string.clear();