diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-04-14 22:36:08 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-04-14 22:36:08 +0000 |
| commit | cf8a8294e5b09ce3605b4a8a586e7d1a7a1e0b63 (patch) | |
| tree | 3e6c20e29a944271d923c3b91fb7552cbf5654ec /lldb | |
| parent | 9a458cd51765131f38b04816a05e776323a68af9 (diff) | |
| download | bcm5719-llvm-cf8a8294e5b09ce3605b4a8a586e7d1a7a1e0b63.tar.gz bcm5719-llvm-cf8a8294e5b09ce3605b4a8a586e7d1a7a1e0b63.zip | |
[Interpreter] Make a static func a lambda and remove always_inline.
The attribute was fairly dubious as: a) we shouldn't tell the compiler
when to inline functions, b) GCC complains that the function may be
not always inlinable.
llvm-svn: 300377
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 9fcf325c993..de27f7be30d 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -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)) { |

