diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-02-13 06:25:41 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-02-13 06:25:41 +0000 |
| commit | d5b440369dbb0d41e6ecd47d6ac7410201e27f17 (patch) | |
| tree | 4dc2e3c44bcd3e14143715fa86584862b2290f9f /lldb/source/Commands | |
| parent | 5cf777e41387c84518a9ff2ec1222058daf54e58 (diff) | |
| download | bcm5719-llvm-d5b440369dbb0d41e6ecd47d6ac7410201e27f17.tar.gz bcm5719-llvm-d5b440369dbb0d41e6ecd47d6ac7410201e27f17.zip | |
Replace 'ap' with 'up' suffix in variable names. (NFC)
The `ap` suffix is a remnant of lldb's former use of auto pointers,
before they got deprecated. Although all their uses were replaced by
unique pointers, some variables still carried the suffix.
In r353795 I removed another auto_ptr remnant, namely redundant calls to
::get for unique_pointers. Jim justly noted that this is a good
opportunity to clean up the variable names as well.
I went over all the changes to ensure my find-and-replace didn't have
any undesired side-effects. I hope I didn't miss any, but if you end up
at this commit doing a git blame on a weirdly named variable, please
know that the change was unintentional.
llvm-svn: 353912
Diffstat (limited to 'lldb/source/Commands')
| -rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 24 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectHelp.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectHelp.h | 2 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 20 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectWatchpointCommand.cpp | 18 |
5 files changed, 36 insertions, 35 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index adce7471794..df6ec6492d7 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -890,11 +890,11 @@ protected: auto command_name = args[0].ref; if (!m_interpreter.CommandExists(command_name)) { StreamString error_msg_stream; - const bool generate_apropos = true; + const bool generate_upropos = true; const bool generate_type_lookup = false; CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage( &error_msg_stream, command_name, llvm::StringRef(), llvm::StringRef(), - generate_apropos, generate_type_lookup); + generate_upropos, generate_type_lookup); result.AppendError(error_msg_stream.GetString()); result.SetStatus(eReturnStatusFailed); return false; @@ -988,7 +988,7 @@ protected: void IOHandlerInputComplete(IOHandler &io_handler, std::string &data) override { io_handler.SetIsDone(true); - if (m_regex_cmd_ap) { + if (m_regex_cmd_up) { StringList lines; if (lines.SplitIntoLines(data)) { const size_t num_lines = lines.GetSize(); @@ -1007,8 +1007,8 @@ protected: } } } - if (m_regex_cmd_ap->HasRegexEntries()) { - CommandObjectSP cmd_sp(m_regex_cmd_ap.release()); + if (m_regex_cmd_up->HasRegexEntries()) { + CommandObjectSP cmd_sp(m_regex_cmd_up.release()); m_interpreter.AddCommand(cmd_sp->GetCommandName(), cmd_sp, true); } } @@ -1025,7 +1025,7 @@ protected: Status error; auto name = command[0].ref; - m_regex_cmd_ap = llvm::make_unique<CommandObjectRegexCommand>( + m_regex_cmd_up = llvm::make_unique<CommandObjectRegexCommand>( m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 10, 0, true); @@ -1070,7 +1070,7 @@ protected: bool check_only) { Status error; - if (!m_regex_cmd_ap) { + if (!m_regex_cmd_up) { error.SetErrorStringWithFormat( "invalid regular expression command object for: '%.*s'", (int)regex_sed.size(), regex_sed.data()); @@ -1156,22 +1156,22 @@ protected: std::string subst(regex_sed.substr(second_separator_char_pos + 1, third_separator_char_pos - second_separator_char_pos - 1)); - m_regex_cmd_ap->AddRegexCommand(regex.c_str(), subst.c_str()); + m_regex_cmd_up->AddRegexCommand(regex.c_str(), subst.c_str()); } return error; } void AddRegexCommandToInterpreter() { - if (m_regex_cmd_ap) { - if (m_regex_cmd_ap->HasRegexEntries()) { - CommandObjectSP cmd_sp(m_regex_cmd_ap.release()); + if (m_regex_cmd_up) { + if (m_regex_cmd_up->HasRegexEntries()) { + CommandObjectSP cmd_sp(m_regex_cmd_up.release()); m_interpreter.AddCommand(cmd_sp->GetCommandName(), cmd_sp, true); } } } private: - std::unique_ptr<CommandObjectRegexCommand> m_regex_cmd_ap; + std::unique_ptr<CommandObjectRegexCommand> m_regex_cmd_up; class CommandOptions : public Options { public: diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index b39323e0acb..3804bbe6835 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -20,8 +20,9 @@ using namespace lldb_private; //------------------------------------------------------------------------- void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage( - Stream *s, llvm::StringRef command, llvm::StringRef prefix, llvm::StringRef subcommand, - bool include_apropos, bool include_type_lookup) { + Stream *s, llvm::StringRef command, llvm::StringRef prefix, + llvm::StringRef subcommand, bool include_upropos, + bool include_type_lookup) { if (!s || command.empty()) return; @@ -32,7 +33,7 @@ void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage( s->Printf("'%s' is not a known command.\n", command_str.c_str()); s->Printf("Try '%shelp' to see a current list of commands.\n", prefix.str().c_str()); - if (include_apropos) { + if (include_upropos) { s->Printf("Try '%sapropos %s' for a list of related commands.\n", prefix_str.c_str(), lookup_str.c_str()); } diff --git a/lldb/source/Commands/CommandObjectHelp.h b/lldb/source/Commands/CommandObjectHelp.h index d957a43ca2b..e4dd7af7143 100644 --- a/lldb/source/Commands/CommandObjectHelp.h +++ b/lldb/source/Commands/CommandObjectHelp.h @@ -29,7 +29,7 @@ public: static void GenerateAdditionalHelpAvenuesMessage( Stream *s, llvm::StringRef command, llvm::StringRef prefix, - llvm::StringRef subcommand, bool include_apropos = true, + llvm::StringRef subcommand, bool include_upropos = true, bool include_type_lookup = true); class CommandOptions : public Options { diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index b84df68b746..b2488b75889 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -4770,49 +4770,49 @@ protected: Target::StopHookSP new_hook_sp = target->CreateStopHook(); // First step, make the specifier. - std::unique_ptr<SymbolContextSpecifier> specifier_ap; + std::unique_ptr<SymbolContextSpecifier> specifier_up; if (m_options.m_sym_ctx_specified) { - specifier_ap.reset(new SymbolContextSpecifier( + specifier_up.reset(new SymbolContextSpecifier( m_interpreter.GetDebugger().GetSelectedTarget())); if (!m_options.m_module_name.empty()) { - specifier_ap->AddSpecification( + specifier_up->AddSpecification( m_options.m_module_name.c_str(), SymbolContextSpecifier::eModuleSpecified); } if (!m_options.m_class_name.empty()) { - specifier_ap->AddSpecification( + specifier_up->AddSpecification( m_options.m_class_name.c_str(), SymbolContextSpecifier::eClassOrNamespaceSpecified); } if (!m_options.m_file_name.empty()) { - specifier_ap->AddSpecification( + specifier_up->AddSpecification( m_options.m_file_name.c_str(), SymbolContextSpecifier::eFileSpecified); } if (m_options.m_line_start != 0) { - specifier_ap->AddLineSpecification( + specifier_up->AddLineSpecification( m_options.m_line_start, SymbolContextSpecifier::eLineStartSpecified); } if (m_options.m_line_end != UINT_MAX) { - specifier_ap->AddLineSpecification( + specifier_up->AddLineSpecification( m_options.m_line_end, SymbolContextSpecifier::eLineEndSpecified); } if (!m_options.m_function_name.empty()) { - specifier_ap->AddSpecification( + specifier_up->AddSpecification( m_options.m_function_name.c_str(), SymbolContextSpecifier::eFunctionSpecified); } } - if (specifier_ap) - new_hook_sp->SetSpecifier(specifier_ap.release()); + if (specifier_up) + new_hook_sp->SetSpecifier(specifier_up.release()); // Next see if any of the thread options have been entered: diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index 05bdcb3b935..dfb888190b3 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -225,12 +225,12 @@ are no syntax errors may indicate that a function was declared but never called. WatchpointOptions *wp_options = (WatchpointOptions *)io_handler.GetUserData(); if (wp_options) { - std::unique_ptr<WatchpointOptions::CommandData> data_ap( + std::unique_ptr<WatchpointOptions::CommandData> data_up( new WatchpointOptions::CommandData()); - if (data_ap) { - data_ap->user_source.SplitIntoLines(line); + if (data_up) { + data_up->user_source.SplitIntoLines(line); auto baton_sp = std::make_shared<WatchpointOptions::CommandBaton>( - std::move(data_ap)); + std::move(data_up)); wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp); } } @@ -249,19 +249,19 @@ are no syntax errors may indicate that a function was declared but never called. /// Set a one-liner as the callback for the watchpoint. void SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *oneliner) { - std::unique_ptr<WatchpointOptions::CommandData> data_ap( + std::unique_ptr<WatchpointOptions::CommandData> data_up( new WatchpointOptions::CommandData()); // It's necessary to set both user_source and script_source to the // oneliner. The former is used to generate callback description (as in // watchpoint command list) while the latter is used for Python to // interpret during the actual callback. - data_ap->user_source.AppendString(oneliner); - data_ap->script_source.assign(oneliner); - data_ap->stop_on_error = m_options.m_stop_on_error; + data_up->user_source.AppendString(oneliner); + data_up->script_source.assign(oneliner); + data_up->stop_on_error = m_options.m_stop_on_error; auto baton_sp = - std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_ap)); + std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_up)); wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp); } |

