aboutsummaryrefslogtreecommitdiff
path: root/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--source/Interpreter/CommandInterpreter.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index d44eb25848dc..de27f7be30d3 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -42,12 +42,12 @@
#include "../Commands/CommandObjectWatchpoint.h"
#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/State.h"
-#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/Timer.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Stream.h"
#ifndef LLDB_DISABLE_LIBEDIT
#include "lldb/Host/Editline.h"
@@ -2018,8 +2018,8 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj,
}
for (auto entry : llvm::enumerate(cmd_args.entries())) {
- if (!used[entry.Index] && !wants_raw_input)
- new_args.AppendArgument(entry.Value.ref);
+ if (!used[entry.index()] && !wants_raw_input)
+ new_args.AppendArgument(entry.value().ref);
}
cmd_args.Clear();
@@ -2542,14 +2542,6 @@ void CommandInterpreter::OutputFormattedHelpText(Stream &strm,
OutputFormattedHelpText(strm, prefix_stream.GetString(), help_text);
}
-LLVM_ATTRIBUTE_ALWAYS_INLINE
-static size_t nextWordLength(llvm::StringRef S) {
- size_t pos = S.find_first_of(' ');
- if (pos == llvm::StringRef::npos)
- return S.size();
- return pos;
-}
-
void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text,
llvm::StringRef separator,
llvm::StringRef help_text,
@@ -2568,6 +2560,11 @@ void CommandInterpreter::OutputHelpText(Stream &strm, llvm::StringRef word_text,
uint32_t chars_left = max_columns;
+ auto nextWordLength = [](llvm::StringRef S) {
+ size_t pos = S.find_first_of(' ');
+ return pos == llvm::StringRef::npos ? S.size() : pos;
+ };
+
while (!text.empty()) {
if (text.front() == '\n' ||
(text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) {