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/CommandObjectCommands.cpp | |
| parent | 930ebc15a6398710e84eea16b735721fe4a2c2fd (diff) | |
| download | bcm5719-llvm-0d9a201e2624998922f825ebbe01aae0cce4bbd5.tar.gz bcm5719-llvm-0d9a201e2624998922f825ebbe01aae0cce4bbd5.zip | |
[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/CommandObjectCommands.cpp')
| -rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index d2f4cea1ad8..c20c624ab90 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)) { |

