From 917b8df0e531d4b2ecb9c9bc7370a75905587bbc Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 8 Oct 2019 16:29:36 +0000 Subject: [PATCH] Replace static const StringRef with StringRef (NFC) Differential Revision: https://reviews.llvm.org/D68597 llvm-svn: 374081 --- lldb/source/Interpreter/OptionValueBoolean.cpp | 6 +++--- .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 4 ++-- .../Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lldb/source/Interpreter/OptionValueBoolean.cpp b/lldb/source/Interpreter/OptionValueBoolean.cpp index 4a08415..6f893a9 100644 --- a/lldb/source/Interpreter/OptionValueBoolean.cpp +++ b/lldb/source/Interpreter/OptionValueBoolean.cpp @@ -73,10 +73,10 @@ lldb::OptionValueSP OptionValueBoolean::DeepCopy() const { void OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter, CompletionRequest &request) { - static const llvm::StringRef g_autocomplete_entries[] = { - "true", "false", "on", "off", "yes", "no", "1", "0"}; + llvm::StringRef autocomplete_entries[] = {"true", "false", "on", "off", + "yes", "no", "1", "0"}; - auto entries = llvm::makeArrayRef(g_autocomplete_entries); + auto entries = llvm::makeArrayRef(autocomplete_entries); // only suggest "true" or "false" by default if (request.GetCursorArgumentPrefix().empty()) diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 5284775..d5a47d1 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -2029,8 +2029,8 @@ lldb::addr_t AppleObjCRuntimeV2::LookupRuntimeSymbol(ConstString name) { if (name_cstr) { llvm::StringRef name_strref(name_cstr); - static const llvm::StringRef ivar_prefix("OBJC_IVAR_$_"); - static const llvm::StringRef class_prefix("OBJC_CLASS_$_"); + llvm::StringRef ivar_prefix("OBJC_IVAR_$_"); + llvm::StringRef class_prefix("OBJC_CLASS_$_"); if (name_strref.startswith(ivar_prefix)) { llvm::StringRef ivar_skipped_prefix = diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 458261f..46177e7 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -2059,9 +2059,9 @@ size_t ObjectFileMachO::ParseSymtab() { uint32_t i; FileSpecList dylib_files; Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS)); - static const llvm::StringRef g_objc_v2_prefix_class("_OBJC_CLASS_$_"); - static const llvm::StringRef g_objc_v2_prefix_metaclass("_OBJC_METACLASS_$_"); - static const llvm::StringRef g_objc_v2_prefix_ivar("_OBJC_IVAR_$_"); + llvm::StringRef g_objc_v2_prefix_class("_OBJC_CLASS_$_"); + llvm::StringRef g_objc_v2_prefix_metaclass("_OBJC_METACLASS_$_"); + llvm::StringRef g_objc_v2_prefix_ivar("_OBJC_IVAR_$_"); for (i = 0; i < m_header.ncmds; ++i) { const lldb::offset_t cmd_offset = offset; @@ -3314,13 +3314,13 @@ size_t ObjectFileMachO::ParseSymtab() { if (symbol_name) { llvm::StringRef symbol_name_ref(symbol_name); if (symbol_name_ref.startswith("_OBJC_")) { - static const llvm::StringRef + llvm::StringRef g_objc_v2_prefix_class( "_OBJC_CLASS_$_"); - static const llvm::StringRef + llvm::StringRef g_objc_v2_prefix_metaclass( "_OBJC_METACLASS_$_"); - static const llvm::StringRef + llvm::StringRef g_objc_v2_prefix_ivar("_OBJC_IVAR_$_"); if (symbol_name_ref.startswith( g_objc_v2_prefix_class)) { @@ -3370,7 +3370,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeRuntime; if (symbol_name && symbol_name[0] == '.') { llvm::StringRef symbol_name_ref(symbol_name); - static const llvm::StringRef + llvm::StringRef g_objc_v1_prefix_class(".objc_class_name_"); if (symbol_name_ref.startswith( g_objc_v1_prefix_class)) { @@ -4206,11 +4206,11 @@ size_t ObjectFileMachO::ParseSymtab() { if (symbol_name) { llvm::StringRef symbol_name_ref(symbol_name); if (symbol_name_ref.startswith("_OBJC_")) { - static const llvm::StringRef g_objc_v2_prefix_class( + llvm::StringRef g_objc_v2_prefix_class( "_OBJC_CLASS_$_"); - static const llvm::StringRef g_objc_v2_prefix_metaclass( + llvm::StringRef g_objc_v2_prefix_metaclass( "_OBJC_METACLASS_$_"); - static const llvm::StringRef g_objc_v2_prefix_ivar( + llvm::StringRef g_objc_v2_prefix_ivar( "_OBJC_IVAR_$_"); if (symbol_name_ref.startswith(g_objc_v2_prefix_class)) { symbol_name_non_abi_mangled = symbol_name + 1; @@ -4250,7 +4250,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeRuntime; if (symbol_name && symbol_name[0] == '.') { llvm::StringRef symbol_name_ref(symbol_name); - static const llvm::StringRef g_objc_v1_prefix_class( + llvm::StringRef g_objc_v1_prefix_class( ".objc_class_name_"); if (symbol_name_ref.startswith(g_objc_v1_prefix_class)) { symbol_name_non_abi_mangled = symbol_name; -- 2.7.4