Author: enrico Date: Mon Mar 7 21:48:41 2016 New Revision: 262905 URL: http://llvm.org/viewvc/llvm-project?rev=262905&view=rev Log: Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free template function in lldb_private
Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h lldb/trunk/include/lldb/Interpreter/CommandObject.h lldb/trunk/source/Commands/CommandObjectMultiword.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=262905&r1=262904&r2=262905&view=diff ============================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original) +++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Mon Mar 7 21:48:41 2016 @@ -533,10 +533,6 @@ public: bool GetSynchronous (); - template <typename ValueType> - size_t - FindLongestCommandWord (std::map<std::string,ValueType> &dict); - void FindCommandsForApropos (const char *word, StringList &commands_found, Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=262905&r1=262904&r2=262905&view=diff ============================================================================== --- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original) +++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Mon Mar 7 21:48:41 2016 @@ -70,7 +70,23 @@ AddNamesMatchingPartialString (std::map< } return number_added; } + +template <typename ValueType> +size_t +FindLongestCommandWord (std::map<std::string,ValueType> &dict) +{ + auto end = dict.end(); + size_t max_len = 0; + for (auto pos = dict.begin(); pos != end; ++pos) + { + size_t len = pos->first.size(); + if (max_len < len) + max_len = len; + } + return max_len; +} + class CommandObject { public: Modified: lldb/trunk/source/Commands/CommandObjectMultiword.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMultiword.cpp?rev=262905&r1=262904&r2=262905&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectMultiword.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectMultiword.cpp Mon Mar 7 21:48:41 2016 @@ -181,7 +181,7 @@ CommandObjectMultiword::GenerateHelpText output_stream.PutCString ("The following subcommands are supported:\n\n"); CommandMap::iterator pos; - uint32_t max_len = m_interpreter.FindLongestCommandWord (m_subcommand_dict); + uint32_t max_len = FindLongestCommandWord (m_subcommand_dict); if (max_len) max_len += 4; // Indent the output by 4 spaces. Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=262905&r1=262904&r2=262905&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Mar 7 21:48:41 2016 @@ -1200,22 +1200,6 @@ CommandInterpreter::GetAliasHelp (const help_string.Printf ("'"); } -template <typename ValueType> -size_t -CommandInterpreter::FindLongestCommandWord (std::map<std::string,ValueType> &dict) -{ - auto end = dict.end(); - size_t max_len = 0; - - for (auto pos = dict.begin(); pos != end; ++pos) - { - size_t len = pos->first.size(); - if (max_len < len) - max_len = len; - } - return max_len; -} - void CommandInterpreter::GetHelp (CommandReturnObject &result, uint32_t cmd_types) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits