From 0d9a201e2624998922f825ebbe01aae0cce4bbd5 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 13 Sep 2019 11:26:48 +0000 Subject: [lldb][NFC] Remove ArgEntry::ref member The StringRef should always be identical to the C string, so we might as well just create the StringRef from the C-string. This might be slightly slower until we implement the storage of ArgEntry with a string instead of a std::unique_ptr. Until then we have to do the additional strlen on the C string to construct the StringRef. llvm-svn: 371842 --- lldb/source/Commands/CommandObjectProcess.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Commands/CommandObjectProcess.cpp') diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index eb559cd9ba7..b494740c62a 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -923,7 +923,7 @@ protected: for (auto &entry : command.entries()) { Status error; PlatformSP platform = process->GetTarget().GetPlatform(); - llvm::StringRef image_path = entry.ref; + llvm::StringRef image_path = entry.ref(); uint32_t image_token = LLDB_INVALID_IMAGE_TOKEN; if (!m_options.do_install) { @@ -985,9 +985,9 @@ protected: for (auto &entry : command.entries()) { uint32_t image_token; - if (entry.ref.getAsInteger(0, image_token)) { + if (entry.ref().getAsInteger(0, image_token)) { result.AppendErrorWithFormat("invalid image index argument '%s'", - entry.ref.str().c_str()); + entry.ref().str().c_str()); result.SetStatus(eReturnStatusFailed); break; } else { -- cgit v1.2.3