[Lldb-commits] [lldb] ff058e7 - [lldb] Remove unnecessary c_str() in OutputFormattedHelpText calls (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 12 21:13:53 PDT 2020
Author: Jonas Devlieghere
Date: 2020-06-12T21:13:21-07:00
New Revision: ff058e7331afb16108a8f888dff671ae0240268f
URL: https://github.com/llvm/llvm-project/commit/ff058e7331afb16108a8f888dff671ae0240268f
DIFF: https://github.com/llvm/llvm-project/commit/ff058e7331afb16108a8f888dff671ae0240268f.diff
LOG: [lldb] Remove unnecessary c_str() in OutputFormattedHelpText calls (NFC)
Added:
Modified:
lldb/source/Commands/CommandObjectMultiword.cpp
lldb/source/Interpreter/CommandObject.cpp
Removed:
################################################################################
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index ca0e058430bc..9033cfebf46b 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -167,13 +167,12 @@ void CommandObjectMultiword::GenerateHelpText(Stream &output_stream) {
if (pos->second->WantsRawCommandString()) {
std::string help_text(std::string(pos->second->GetHelp()));
help_text.append(" Expects 'raw' input (see 'help raw-input'.)");
- m_interpreter.OutputFormattedHelpText(output_stream,
- indented_command.c_str(), "--",
- help_text.c_str(), max_len);
+ m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
+ "--", help_text, max_len);
} else
- m_interpreter.OutputFormattedHelpText(output_stream,
- indented_command.c_str(), "--",
- pos->second->GetHelp(), max_len);
+ m_interpreter.OutputFormattedHelpText(output_stream, indented_command,
+ "--", pos->second->GetHelp(),
+ max_len);
}
output_stream.PutCString("\nFor more help on any particular subcommand, type "
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index dfae7bec64f7..64a46e3f14f0 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -836,8 +836,8 @@ void CommandObject::FormatLongHelpText(Stream &output_strm,
}
std::string whitespace_prefix = line.substr(0, result);
std::string remainder = line.substr(result);
- interpreter.OutputFormattedHelpText(output_strm, whitespace_prefix.c_str(),
- remainder.c_str());
+ interpreter.OutputFormattedHelpText(output_strm, whitespace_prefix,
+ remainder);
}
}
@@ -852,8 +852,7 @@ void CommandObject::GenerateHelpText(Stream &output_strm) {
if (WantsRawCommandString()) {
std::string help_text(GetHelp());
help_text.append(" Expects 'raw' input (see 'help raw-input'.)");
- interpreter.OutputFormattedHelpText(output_strm, "", "", help_text.c_str(),
- 1);
+ interpreter.OutputFormattedHelpText(output_strm, "", "", help_text, 1);
} else
interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1);
output_strm << "\nSyntax: " << GetSyntax() << "\n";
More information about the lldb-commits
mailing list