From adcd02683856c30ba6f349279509acecd90063df Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 28 Jan 2020 20:23:46 +0100 Subject: 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. --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index 3edef53ec139..14eea2df3810 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -99,7 +99,7 @@ std::string NativeThreadLinux::GetName() { auto BufferOrError = getProcFile(process.GetID(), GetID(), "comm"); if (!BufferOrError) return ""; - return BufferOrError.get()->getBuffer().rtrim('\n'); + return std::string(BufferOrError.get()->getBuffer().rtrim('\n')); } lldb::StateType NativeThreadLinux::GetState() { return m_state; } -- cgit v1.2.3