diff options
author | Zachary Turner <zturner@google.com> | 2016-12-09 01:20:58 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-12-09 01:20:58 +0000 |
commit | 867e7d17655367377137393ea7d2fa68268d3001 (patch) | |
tree | 31a4d2550d1092c6d4761d27ddf56b4206a1d82f /lldb/source/Commands/CommandObjectApropos.cpp | |
parent | e9492f72397b11209799b056508fb02ed4438caa (diff) | |
download | bcm5719-llvm-867e7d17655367377137393ea7d2fa68268d3001.tar.gz bcm5719-llvm-867e7d17655367377137393ea7d2fa68268d3001.zip |
Fix some occurrences of passing StringRef to Printf.
Hopefully these will all disappear in the future once we move
to formatv.
llvm-svn: 289168
Diffstat (limited to 'lldb/source/Commands/CommandObjectApropos.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectApropos.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp index c70d0217fc7..b04d08f0136 100644 --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -51,11 +51,10 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { const size_t argc = args.GetArgumentCount(); if (argc == 1) { - const char *search_word = args.GetArgumentAtIndex(0); - if ((search_word != nullptr) && (strlen(search_word) > 0)) { + 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. + // the command dictionary is private. StringList commands_found; StringList commands_help; @@ -66,11 +65,11 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { result.AppendMessageWithFormat("No commands found pertaining to '%s'. " "Try 'help' to see a complete list of " "debugger commands.\n", - search_word); + args[0].c_str()); } else { if (commands_found.GetSize() > 0) { result.AppendMessageWithFormat( - "The following commands may relate to '%s':\n", search_word); + "The following commands may relate to '%s':\n", args[0].c_str()); size_t max_len = 0; for (size_t i = 0; i < commands_found.GetSize(); ++i) { @@ -93,7 +92,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { const bool dump_qualified_name = true; result.AppendMessageWithFormat( "\nThe following settings variables may relate to '%s': \n\n", - search_word); + args[0].c_str()); for (size_t i = 0; i < num_properties; ++i) properties[i]->DumpDescription( m_interpreter, result.GetOutputStream(), 0, dump_qualified_name); |