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 --- .../CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp') diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index 4e50ae0be28..6713a0ad674 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -348,7 +348,7 @@ protected: bool demangled_any = false; bool error_any = false; for (auto &entry : command.entries()) { - if (entry.ref.empty()) + if (entry.ref().empty()) continue; // the actual Mangled class should be strict about this, but on the @@ -356,7 +356,7 @@ protected: // they will come out with an extra underscore - be willing to strip this // on behalf of the user. This is the moral equivalent of the -_/-n // options to c++filt - auto name = entry.ref; + auto name = entry.ref(); if (name.startswith("__Z")) name = name.drop_front(); @@ -365,12 +365,12 @@ protected: ConstString demangled( mangled.GetDisplayDemangledName(lldb::eLanguageTypeC_plus_plus)); demangled_any = true; - result.AppendMessageWithFormat("%s ---> %s\n", entry.ref.str().c_str(), + result.AppendMessageWithFormat("%s ---> %s\n", entry.c_str(), demangled.GetCString()); } else { error_any = true; result.AppendErrorWithFormat("%s is not a valid C++ mangled name\n", - entry.ref.str().c_str()); + entry.ref().str().c_str()); } } -- cgit v1.2.3