diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-13 11:26:48 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-13 11:26:48 +0000 |
commit | 0d9a201e2624998922f825ebbe01aae0cce4bbd5 (patch) | |
tree | 3d844315931e3026c40a44de0d2117368e82360d /lldb/source/Commands | |
parent | 930ebc15a6398710e84eea16b735721fe4a2c2fd (diff) | |
download | llvm-0d9a201e2624998922f825ebbe01aae0cce4bbd5.zip llvm-0d9a201e2624998922f825ebbe01aae0cce4bbd5.tar.gz llvm-0d9a201e2624998922f825ebbe01aae0cce4bbd5.tar.bz2 |
[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<char[]>. Until then we
have to do the additional strlen on the C string to construct the
StringRef.
llvm-svn: 371842
Diffstat (limited to 'lldb/source/Commands')
18 files changed, 87 insertions, 87 deletions
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp index b0ef03a..7ba0b25 100644 --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -44,7 +44,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { const size_t argc = args.GetArgumentCount(); if (argc == 1) { - auto search_word = args[0].ref; + auto search_word = args[0].ref(); if (!search_word.empty()) { // The bulk of the work must be done inside the Command Interpreter, // since the command dictionary is private. @@ -79,7 +79,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { const bool dump_qualified_name = true; result.AppendMessageWithFormatv( "\nThe following settings variables may relate to '{0}': \n\n", - args[0].ref); + args[0].ref()); for (size_t i = 0; i < num_properties; ++i) properties[i]->DumpDescription( m_interpreter, result.GetOutputStream(), 0, dump_qualified_name); diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 60a5e92..e73c924 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -1707,7 +1707,7 @@ protected: // Make a pass through first to see that all the names are legal. for (auto &entry : command.entries()) { Status error; - if (!BreakpointID::StringIsBreakpointName(entry.ref, error)) + if (!BreakpointID::StringIsBreakpointName(entry.ref(), error)) { result.AppendErrorWithFormat("Invalid breakpoint name: %s - %s", entry.c_str(), error.AsCString()); diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index d2f4cea..c20c624 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -283,7 +283,7 @@ protected: return false; } - FileSpec cmd_file(command[0].ref); + FileSpec cmd_file(command[0].ref()); FileSystem::Instance().Resolve(cmd_file); ExecutionContext *exe_ctx = nullptr; // Just use the default context. @@ -546,7 +546,7 @@ protected: // Get the alias command. - auto alias_command = args[0].ref; + auto alias_command = args[0].ref(); if (alias_command.startswith("-")) { result.AppendError("aliases starting with a dash are not supported"); if (alias_command == "--help" || alias_command == "--long-help") { @@ -653,8 +653,8 @@ protected: } // Save these in std::strings since we're going to shift them off. - const std::string alias_command(args[0].ref); - const std::string actual_command(args[1].ref); + const std::string alias_command(args[0].ref()); + const std::string actual_command(args[1].ref()); args.Shift(); // Shift the alias command word off the argument vector. args.Shift(); // Shift the old command word off the argument vector. @@ -686,7 +686,7 @@ protected: OptionArgVectorSP(new OptionArgVector); while (cmd_obj->IsMultiwordObject() && !args.empty()) { - auto sub_command = args[0].ref; + auto sub_command = args[0].ref(); assert(!sub_command.empty()); subcommand_obj_sp = cmd_obj->GetSubcommandSP(sub_command); if (!subcommand_obj_sp) { @@ -780,7 +780,7 @@ protected: return false; } - auto command_name = args[0].ref; + auto command_name = args[0].ref(); cmd_obj = m_interpreter.GetCommandObject(command_name); if (!cmd_obj) { result.AppendErrorWithFormat( @@ -862,7 +862,7 @@ protected: return false; } - auto command_name = args[0].ref; + auto command_name = args[0].ref(); if (!m_interpreter.CommandExists(command_name)) { StreamString error_msg_stream; const bool generate_upropos = true; @@ -988,7 +988,7 @@ protected: } Status error; - auto name = command[0].ref; + auto name = command[0].ref(); m_regex_cmd_up = std::make_unique<CommandObjectRegexCommand>( m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 10, 0, true); @@ -1013,7 +1013,7 @@ protected: } else { for (auto &entry : command.entries().drop_front()) { bool check_only = false; - error = AppendRegexSubstitution(entry.ref, check_only); + error = AppendRegexSubstitution(entry.ref(), check_only); if (error.Fail()) break; } @@ -1656,7 +1656,7 @@ protected: } // Store the options in case we get multi-line input - m_cmd_name = command[0].ref; + m_cmd_name = command[0].ref(); m_short_help.assign(m_options.m_short_help); m_synchronicity = m_options.m_synchronicity; @@ -1798,7 +1798,7 @@ protected: return false; } - auto cmd_name = command[0].ref; + auto cmd_name = command[0].ref(); if (cmd_name.empty() || !m_interpreter.HasUserCommands() || !m_interpreter.UserCommandExists(cmd_name)) { diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 5cf2d6c..89efdab 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -358,7 +358,7 @@ protected: } if (command.GetArgumentCount() == 1) { - if (command[0].ref.getAsInteger(0, frame_idx)) { + if (command[0].ref().getAsInteger(0, frame_idx)) { result.AppendErrorWithFormat("invalid frame index argument '%s'.", command[0].c_str()); result.SetStatus(eReturnStatusFailed); @@ -527,7 +527,7 @@ protected: for (auto &entry : command) { if (m_option_variable.use_regex) { const size_t regex_start_index = regex_var_list.GetSize(); - llvm::StringRef name_str = entry.ref; + llvm::StringRef name_str = entry.ref(); RegularExpression regex(name_str); if (regex.IsValid()) { size_t num_matches = 0; @@ -586,7 +586,7 @@ protected: StackFrame::eExpressionPathOptionsInspectAnonymousUnions; lldb::VariableSP var_sp; valobj_sp = frame->GetValueForVariableExpressionPath( - entry.ref, m_varobj_options.use_dynamic, expr_path_options, + entry.ref(), m_varobj_options.use_dynamic, expr_path_options, var_sp, error); if (valobj_sp) { std::string scope_string; diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index 78e19f73..34f6e5d 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -96,7 +96,7 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { // Get command object for the first command argument. Only search built-in // command dictionary. StringList matches; - auto command_name = command[0].ref; + auto command_name = command[0].ref(); cmd_obj = m_interpreter.GetCommandObject(command_name, &matches); if (cmd_obj != nullptr) { @@ -107,7 +107,7 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { // object that corresponds to the help command entered. std::string sub_command; for (auto &entry : command.entries().drop_front()) { - sub_command = entry.ref; + sub_command = entry.ref(); matches.Clear(); if (sub_cmd_obj->IsAlias()) sub_cmd_obj = @@ -208,7 +208,7 @@ void CommandObjectHelp::HandleCompletion(CompletionRequest &request) { return; } CommandObject *cmd_obj = - m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref); + m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref()); // The command that they are getting help on might be ambiguous, in which // case we should complete that, otherwise complete with the command the diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index 314405e..3035a64 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -145,7 +145,7 @@ protected: } // Store into a std::string since we're about to shift the channel off. - const std::string channel = args[0].ref; + const std::string channel = args[0].ref(); args.Shift(); // Shift off the channel char log_file[PATH_MAX]; if (m_options.log_file) @@ -212,7 +212,7 @@ protected: return false; } - const std::string channel = args[0].ref; + const std::string channel = args[0].ref(); args.Shift(); // Shift off the channel if (channel == "all") { Log::DisableAllLogChannels(); @@ -265,7 +265,7 @@ protected: bool success = true; for (const auto &entry : args.entries()) success = - success && Log::ListChannelCategories(entry.ref, output_stream); + success && Log::ListChannelCategories(entry.ref(), output_stream); if (success) result.SetStatus(eReturnStatusSuccessFinishResult); } @@ -291,7 +291,7 @@ protected: result.SetStatus(eReturnStatusFailed); if (args.GetArgumentCount() == 1) { - auto sub_command = args[0].ref; + auto sub_command = args[0].ref(); if (sub_command.equals_lower("enable")) { Timer::SetDisplayDepth(UINT32_MAX); @@ -308,8 +308,8 @@ protected: result.SetStatus(eReturnStatusSuccessFinishResult); } } else if (args.GetArgumentCount() == 2) { - auto sub_command = args[0].ref; - auto param = args[1].ref; + auto sub_command = args[0].ref(); + auto param = args[1].ref(); if (sub_command.equals_lower("enable")) { uint32_t depth; diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 57ff00f..1e9c990 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -593,7 +593,7 @@ protected: } if (argc > 0) - addr = OptionArgParser::ToAddress(&m_exe_ctx, command[0].ref, + addr = OptionArgParser::ToAddress(&m_exe_ctx, command[0].ref(), LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { @@ -605,7 +605,7 @@ protected: if (argc == 2) { lldb::addr_t end_addr = OptionArgParser::ToAddress( - &m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, nullptr); + &m_exe_ctx, command[1].ref(), LLDB_INVALID_ADDRESS, nullptr); if (end_addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid end address expression."); result.AppendError(error.AsCString()); @@ -1034,13 +1034,13 @@ protected: Status error; lldb::addr_t low_addr = OptionArgParser::ToAddress( - &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); + &m_exe_ctx, command[0].ref(), LLDB_INVALID_ADDRESS, &error); if (low_addr == LLDB_INVALID_ADDRESS || error.Fail()) { result.AppendError("invalid low address"); return false; } lldb::addr_t high_addr = OptionArgParser::ToAddress( - &m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, &error); + &m_exe_ctx, command[1].ref(), LLDB_INVALID_ADDRESS, &error); if (high_addr == LLDB_INVALID_ADDRESS || error.Fail()) { result.AppendError("invalid high address"); return false; @@ -1339,7 +1339,7 @@ protected: Status error; lldb::addr_t addr = OptionArgParser::ToAddress( - &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); + &m_exe_ctx, command[0].ref(), LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression\n"); @@ -1442,10 +1442,10 @@ protected: // Be careful, getAsInteger with a radix of 16 rejects "0xab" so we // have to special case that: bool success = false; - if (entry.ref.startswith("0x")) - success = !entry.ref.getAsInteger(0, uval64); + if (entry.ref().startswith("0x")) + success = !entry.ref().getAsInteger(0, uval64); if (!success) - success = !entry.ref.getAsInteger(16, uval64); + success = !entry.ref().getAsInteger(16, uval64); if (!success) { result.AppendErrorWithFormat( "'%s' is not a valid hex string value.\n", entry.c_str()); @@ -1463,7 +1463,7 @@ protected: break; } case eFormatBoolean: - uval64 = OptionArgParser::ToBoolean(entry.ref, false, &success); + uval64 = OptionArgParser::ToBoolean(entry.ref(), false, &success); if (!success) { result.AppendErrorWithFormat( "'%s' is not a valid boolean string value.\n", entry.c_str()); @@ -1474,7 +1474,7 @@ protected: break; case eFormatBinary: - if (entry.ref.getAsInteger(2, uval64)) { + if (entry.ref().getAsInteger(2, uval64)) { result.AppendErrorWithFormat( "'%s' is not a valid binary string value.\n", entry.c_str()); result.SetStatus(eReturnStatusFailed); @@ -1493,10 +1493,10 @@ protected: case eFormatCharArray: case eFormatChar: case eFormatCString: { - if (entry.ref.empty()) + if (entry.ref().empty()) break; - size_t len = entry.ref.size(); + size_t len = entry.ref().size(); // Include the NULL for C strings... if (m_format_options.GetFormat() == eFormatCString) ++len; @@ -1513,7 +1513,7 @@ protected: break; } case eFormatDecimal: - if (entry.ref.getAsInteger(0, sval64)) { + if (entry.ref().getAsInteger(0, sval64)) { result.AppendErrorWithFormat( "'%s' is not a valid signed decimal value.\n", entry.c_str()); result.SetStatus(eReturnStatusFailed); @@ -1531,7 +1531,7 @@ protected: case eFormatUnsigned: - if (!entry.ref.getAsInteger(0, uval64)) { + if (!entry.ref().getAsInteger(0, uval64)) { result.AppendErrorWithFormat( "'%s' is not a valid unsigned decimal string value.\n", entry.c_str()); @@ -1549,7 +1549,7 @@ protected: break; case eFormatOctal: - if (entry.ref.getAsInteger(8, uval64)) { + if (entry.ref().getAsInteger(8, uval64)) { result.AppendErrorWithFormat( "'%s' is not a valid octal string value.\n", entry.c_str()); result.SetStatus(eReturnStatusFailed); @@ -1635,7 +1635,7 @@ protected: Status error; lldb::addr_t addr = OptionArgParser::ToAddress( - &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); + &m_exe_ctx, command[0].ref(), LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression"); @@ -1700,7 +1700,7 @@ protected: result.SetStatus(eReturnStatusFailed); } else { if (command.GetArgumentCount() == 1) { - auto load_addr_str = command[0].ref; + auto load_addr_str = command[0].ref(); load_addr = OptionArgParser::ToAddress(&m_exe_ctx, load_addr_str, LLDB_INVALID_ADDRESS, &error); if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index a223d70..e33a5e0 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -93,7 +93,7 @@ bool CommandObjectMultiword::Execute(const char *args_string, return result.Succeeded(); } - auto sub_command = args[0].ref; + auto sub_command = args[0].ref(); if (sub_command.empty()) return result.Succeeded(); @@ -180,7 +180,7 @@ void CommandObjectMultiword::GenerateHelpText(Stream &output_stream) { } void CommandObjectMultiword::HandleCompletion(CompletionRequest &request) { - auto arg0 = request.GetParsedLine()[0].ref; + auto arg0 = request.GetParsedLine()[0].ref(); if (request.GetCursorIndex() == 0) { StringList new_matches, descriptions; AddNamesMatchingPartialString(m_subcommand_dict, arg0, new_matches, @@ -225,7 +225,7 @@ const char *CommandObjectMultiword::GetRepeatCommand(Args ¤t_command_args, if (current_command_args.GetArgumentCount() <= index) return nullptr; CommandObject *sub_command_object = - GetSubcommandObject(current_command_args[index].ref); + GetSubcommandObject(current_command_args[index].ref()); if (sub_command_object == nullptr) return nullptr; return sub_command_object->GetRepeatCommand(current_command_args, index); diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 0bd12d1..7fb3783 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -1336,9 +1336,9 @@ protected: Stream &ostrm = result.GetOutputStream(); for (auto &entry : args.entries()) { lldb::pid_t pid; - if (entry.ref.getAsInteger(0, pid)) { + if (entry.ref().getAsInteger(0, pid)) { result.AppendErrorWithFormat("invalid process ID argument '%s'", - entry.ref.str().c_str()); + entry.ref().str().c_str()); result.SetStatus(eReturnStatusFailed); break; } else { diff --git a/lldb/source/Commands/CommandObjectPlugin.cpp b/lldb/source/Commands/CommandObjectPlugin.cpp index 670835c..b708850 100644 --- a/lldb/source/Commands/CommandObjectPlugin.cpp +++ b/lldb/source/Commands/CommandObjectPlugin.cpp @@ -57,7 +57,7 @@ protected: Status error; - FileSpec dylib_fspec(command[0].ref); + FileSpec dylib_fspec(command[0].ref()); FileSystem::Instance().Resolve(dylib_fspec); if (GetDebugger().LoadPlugin(dylib_fspec, error)) diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index eb559cd..b494740 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 { diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index eedfe3c..13266f8 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -206,7 +206,7 @@ protected: // consistent towards the user and allow them to say reg read $rbx - // internally, however, we should be strict and not allow ourselves // to call our registers $rbx in our own API - auto arg_str = entry.ref; + auto arg_str = entry.ref(); arg_str.consume_front("$"); reg_info = reg_ctx->GetRegisterInfoByName(arg_str); @@ -335,8 +335,8 @@ protected: "register write takes exactly 2 arguments: <reg-name> <value>"); result.SetStatus(eReturnStatusFailed); } else { - auto reg_name = command[0].ref; - auto value_str = command[1].ref; + auto reg_name = command[0].ref(); + auto value_str = command[1].ref(); // in most LLDB commands we accept $rbx as the name for register RBX - // and here we would reject it and non-existant. we should be more diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index 8c62bea..f1e3bf12 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -281,7 +281,7 @@ protected: if (!args.empty()) { for (const auto &arg : args) { Status error(GetDebugger().DumpPropertyValue( - &m_exe_ctx, result.GetOutputStream(), arg.ref, + &m_exe_ctx, result.GetOutputStream(), arg.ref(), OptionValue::eDumpGroupValue)); if (error.Success()) { result.GetOutputStream().EOL(); @@ -403,7 +403,7 @@ protected: for (const auto &arg : args) { Status error(GetDebugger().DumpPropertyValue( - &clean_ctx, out_file, arg.ref, OptionValue::eDumpGroupExport)); + &clean_ctx, out_file, arg.ref(), OptionValue::eDumpGroupExport)); if (!error.Success()) { result.AppendError(error.AsCString()); result.SetStatus(eReturnStatusFailed); diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index de82e25..3ac8e91 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -734,7 +734,7 @@ public: // the arguments directly. auto iter = llvm::find_if(current_command_args, [](const Args::ArgEntry &e) { - return e.ref == "-r" || e.ref == "--reverse"; + return e.ref() == "-r" || e.ref() == "--reverse"; }); if (iter == current_command_args.end()) return m_cmd_name.c_str(); diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index a7384a0a..37e61ec 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -625,7 +625,7 @@ protected: for (auto &entry : args.entries()) { uint32_t target_idx; - if (entry.ref.getAsInteger(0, target_idx)) { + if (entry.ref().getAsInteger(0, target_idx)) { result.AppendErrorWithFormat("invalid target index '%s'\n", entry.c_str()); result.SetStatus(eReturnStatusFailed); @@ -2550,10 +2550,10 @@ protected: } } else { for (auto &entry : args.entries()) { - if (entry.ref.empty()) + if (entry.ref().empty()) continue; - FileSpec file_spec(entry.ref); + FileSpec file_spec(entry.ref()); if (FileSystem::Instance().Exists(file_spec)) { ModuleSpec module_spec(file_spec); if (m_uuid_option_group.GetOptionValue().OptionWasSet()) @@ -2583,10 +2583,10 @@ protected: } else { std::string resolved_path = file_spec.GetPath(); result.SetStatus(eReturnStatusFailed); - if (resolved_path != entry.ref) { + if (resolved_path != entry.ref()) { result.AppendErrorWithFormat( "invalid module path '%s' with resolved path '%s'\n", - entry.ref.str().c_str(), resolved_path.c_str()); + entry.ref().str().c_str(), resolved_path.c_str()); break; } result.AppendErrorWithFormat("invalid module path '%s'\n", @@ -4303,9 +4303,9 @@ protected: PlatformSP platform_sp(target->GetPlatform()); for (auto &entry : args.entries()) { - if (!entry.ref.empty()) { + if (!entry.ref().empty()) { auto &symbol_file_spec = module_spec.GetSymbolFileSpec(); - symbol_file_spec.SetFile(entry.ref, FileSpec::Style::native); + symbol_file_spec.SetFile(entry.ref(), FileSpec::Style::native); FileSystem::Instance().Resolve(symbol_file_spec); if (file_option_set) { module_spec.GetFileSpec() = @@ -4329,7 +4329,7 @@ protected: } else { std::string resolved_symfile_path = module_spec.GetSymbolFileSpec().GetPath(); - if (resolved_symfile_path != entry.ref) { + if (resolved_symfile_path != entry.ref()) { result.AppendErrorWithFormat( "invalid module path '%s' with resolved path '%s'\n", entry.c_str(), resolved_symfile_path.c_str()); diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index ccb5122..3fb69b8 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -840,7 +840,7 @@ public: std::vector<Thread *> resume_threads; for (auto &entry : command.entries()) { uint32_t thread_idx; - if (entry.ref.getAsInteger(0, thread_idx)) { + if (entry.ref().getAsInteger(0, thread_idx)) { result.AppendErrorWithFormat( "invalid thread index argument: \"%s\".\n", entry.c_str()); result.SetStatus(eReturnStatusFailed); diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 2216141..fe4cb57 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -80,9 +80,9 @@ static bool WarnOnPotentialUnquotedUnsignedType(Args &command, return false; for (auto entry : llvm::enumerate(command.entries().drop_back())) { - if (entry.value().ref != "unsigned") + if (entry.value().ref() != "unsigned") continue; - auto next = command.entries()[entry.index() + 1].ref; + auto next = command.entries()[entry.index() + 1].ref(); if (next == "int" || next == "short" || next == "char" || next == "long") { result.AppendWarningWithFormat( "unsigned %s being treated as two types. if you meant the combined " @@ -679,15 +679,15 @@ protected: WarnOnPotentialUnquotedUnsignedType(command, result); for (auto &arg_entry : command.entries()) { - if (arg_entry.ref.empty()) { + if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - ConstString typeCS(arg_entry.ref); + ConstString typeCS(arg_entry.ref()); if (m_command_options.m_regex) { - RegularExpression typeRX(arg_entry.ref); + RegularExpression typeRX(arg_entry.ref()); if (!typeRX.IsValid()) { result.AppendError( "regex format error (maybe this is not really a regex?)"); @@ -1328,13 +1328,13 @@ bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary( m_options.m_name, m_options.m_category); for (auto &entry : command.entries()) { - if (entry.ref.empty()) { + if (entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - options->m_target_types << entry.ref; + options->m_target_types << entry.ref(); } m_interpreter.GetPythonCommandsFromIOHandler( @@ -1355,7 +1355,7 @@ bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary( for (auto &entry : command.entries()) { CommandObjectTypeSummaryAdd::AddSummary( - ConstString(entry.ref), script_format, + ConstString(entry.ref()), script_format, (m_options.m_regex ? eRegexSummary : eRegularSummary), m_options.m_category, &error); if (error.Fail()) { @@ -1428,12 +1428,12 @@ bool CommandObjectTypeSummaryAdd::Execute_StringSummary( // now I have a valid format, let's add it to every type Status error; for (auto &arg_entry : command.entries()) { - if (arg_entry.ref.empty()) { + if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - ConstString typeCS(arg_entry.ref); + ConstString typeCS(arg_entry.ref()); AddSummary(typeCS, entry, (m_options.m_regex ? eRegexSummary : eRegularSummary), @@ -1786,7 +1786,7 @@ protected: for (auto &entry : command.entries()) { TypeCategoryImplSP category_sp; - if (DataVisualization::Categories::GetCategory(ConstString(entry.ref), + if (DataVisualization::Categories::GetCategory(ConstString(entry.ref()), category_sp) && category_sp) { category_sp->AddLanguage(m_options.m_cate_language.GetCurrentValue()); @@ -2228,13 +2228,13 @@ bool CommandObjectTypeSynthAdd::Execute_HandwritePython( m_options.m_cascade, m_options.m_regex, m_options.m_category); for (auto &entry : command.entries()) { - if (entry.ref.empty()) { + if (entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - options->m_target_types << entry.ref; + options->m_target_types << entry.ref(); } m_interpreter.GetPythonCommandsFromIOHandler( @@ -2293,13 +2293,13 @@ bool CommandObjectTypeSynthAdd::Execute_PythonClass( Status error; for (auto &arg_entry : command.entries()) { - if (arg_entry.ref.empty()) { + if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - ConstString typeCS(arg_entry.ref); + ConstString typeCS(arg_entry.ref()); if (!AddSynth(typeCS, entry, m_options.m_regex ? eRegexSynth : eRegularSynth, m_options.m_category, &error)) { @@ -2594,13 +2594,13 @@ protected: WarnOnPotentialUnquotedUnsignedType(command, result); for (auto &arg_entry : command.entries()) { - if (arg_entry.ref.empty()) { + if (arg_entry.ref().empty()) { result.AppendError("empty typenames not allowed"); result.SetStatus(eReturnStatusFailed); return false; } - ConstString typeCS(arg_entry.ref); + ConstString typeCS(arg_entry.ref()); if (!AddFilter(typeCS, entry, m_options.m_regex ? eRegexFilter : eRegularFilter, m_options.m_category, &error)) { diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 67fd278..6e59a26c 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -89,12 +89,12 @@ bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs( // Go through the arguments and make a canonical form of arg list containing // only numbers with possible "-" in between. for (auto &entry : args.entries()) { - if ((idx = WithRSAIndex(entry.ref)) == -1) { - StrRefArgs.push_back(entry.ref); + if ((idx = WithRSAIndex(entry.ref())) == -1) { + StrRefArgs.push_back(entry.ref()); continue; } // The Arg contains the range specifier, split it, then. - std::tie(first, second) = entry.ref.split(RSA[idx]); + std::tie(first, second) = entry.ref().split(RSA[idx]); if (!first.empty()) StrRefArgs.push_back(first); StrRefArgs.push_back(Minus); |