Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 18:02:19 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r337152 - in projects/clang700-import/contrib/llvm/tools/lldb: include/lldb/Utility source/Commands source/Core source/Interpreter source/Plugins/SymbolFile/DWARF source/Symbol source/U...
Message-ID:  <201808021802.w72I2JQc044399@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Aug  2 18:02:18 2018
New Revision: 337152
URL: https://svnweb.freebsd.org/changeset/base/337152

Log:
  Merge lldb trunk r338150 (just before the 7.0.0 branch point), and
  resolve conflicts.

Modified:
  projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/CompletionRequest.h
  projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/Stream.h
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValue.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueArch.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueBoolean.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueEnumeration.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueUUID.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  projects/clang700-import/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/CompletionRequest.cpp
  projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/Stream.cpp
Directory Properties:
  projects/clang700-import/contrib/llvm/tools/lldb/   (props changed)

Modified: projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/CompletionRequest.h
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/CompletionRequest.h	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/CompletionRequest.h	Thu Aug  2 18:02:18 2018	(r337152)
@@ -13,6 +13,7 @@
 #include "lldb/Utility/Args.h"
 #include "lldb/Utility/StringList.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSet.h"
 
 namespace lldb_private {
 
@@ -77,9 +78,30 @@ class CompletionRequest { (public)
 
   void SetWordComplete(bool v) { m_word_complete = v; }
 
-  /// The array of matches returned.
-  StringList &GetMatches() { return *m_matches; }
+  /// Adds a possible completion string. If the completion was already
+  /// suggested before, it will not be added to the list of results. A copy of
+  /// the suggested completion is stored, so the given string can be free'd
+  /// afterwards.
+  ///
+  /// @param match The suggested completion.
+  void AddCompletion(llvm::StringRef completion) {
+    // Add the completion if we haven't seen the same value before.
+    if (m_match_set.insert(completion).second)
+      m_matches->AppendString(completion);
+  }
 
+  /// Adds multiple possible completion strings.
+  ///
+  /// \param completions The list of completions.
+  ///
+  /// @see AddCompletion
+  void AddCompletions(const StringList &completions) {
+    for (std::size_t i = 0; i < completions.GetSize(); ++i)
+      AddCompletion(completions.GetStringAtIndex(i));
+  }
+
+  std::size_t GetNumberOfMatches() const { return m_matches->GetSize(); }
+
   llvm::StringRef GetCursorArgument() const {
     return GetParsedLine().GetArgumentAtIndex(GetCursorIndex());
   }
@@ -111,8 +133,15 @@ class CompletionRequest { (public)
   /// \btrue if this is a complete option value (a space will be inserted
   /// after the completion.)  \bfalse otherwise.
   bool m_word_complete = false;
-  // We don't own the list.
+
+  // Note: This list is kept private. This is by design to prevent that any
+  // completion depends on any already computed completion from another backend.
+  // Note: We don't own the list. It's owned by the creator of the
+  // CompletionRequest object.
   StringList *m_matches;
+
+  /// List of added completions so far. Used to filter out duplicates.
+  llvm::StringSet<> m_match_set;
 };
 
 } // namespace lldb_private

Modified: projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/Stream.h
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/Stream.h	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/Stream.h	Thu Aug  2 18:02:18 2018	(r337152)
@@ -524,8 +524,6 @@ class Stream { (public)
   //------------------------------------------------------------------
   size_t PutULEB128(uint64_t uval);
 
-  static void UnitTest(Stream *s);
-
 protected:
   //------------------------------------------------------------------
   // Member variables

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandCompletions.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -90,7 +90,7 @@ int CommandCompletions::SourceFiles(CommandInterpreter
   } else {
     completer.DoCompletion(searcher);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
@@ -103,7 +103,7 @@ static int DiskFilesOrDirectories(const llvm::Twine &p
   partial_name.toVector(CompletionBuffer);
 
   if (CompletionBuffer.size() >= PATH_MAX)
-    return 0;
+    return matches.GetSize();
 
   namespace fs = llvm::sys::fs;
   namespace path = llvm::sys::path;
@@ -145,7 +145,7 @@ static int DiskFilesOrDirectories(const llvm::Twine &p
       // Make sure it ends with a separator.
       path::append(CompletionBuffer, path::get_separator());
       matches.AppendString(CompletionBuffer);
-      return 1;
+      return matches.GetSize();
     }
 
     // We want to keep the form the user typed, so we special case this to
@@ -224,13 +224,21 @@ static int DiskFilesOrDirectories(const llvm::Twine &p
   return matches.GetSize();
 }
 
+static int DiskFilesOrDirectories(CompletionRequest &request,
+                                  bool only_directories) {
+  request.SetWordComplete(false);
+  StandardTildeExpressionResolver resolver;
+  StringList matches;
+  DiskFilesOrDirectories(request.GetCursorArgumentPrefix(), only_directories,
+                         matches, resolver);
+  request.AddCompletions(matches);
+  return request.GetNumberOfMatches();
+}
+
 int CommandCompletions::DiskFiles(CommandInterpreter &interpreter,
                                   CompletionRequest &request,
                                   SearchFilter *searcher) {
-  request.SetWordComplete(false);
-  StandardTildeExpressionResolver Resolver;
-  return DiskFiles(request.GetCursorArgumentPrefix(), request.GetMatches(),
-                   Resolver);
+  return DiskFilesOrDirectories(request, /*only_dirs*/ false);
 }
 
 int CommandCompletions::DiskFiles(const llvm::Twine &partial_file_name,
@@ -242,10 +250,7 @@ int CommandCompletions::DiskFiles(const llvm::Twine &p
 int CommandCompletions::DiskDirectories(CommandInterpreter &interpreter,
                                         CompletionRequest &request,
                                         SearchFilter *searcher) {
-  request.SetWordComplete(false);
-  StandardTildeExpressionResolver Resolver;
-  return DiskDirectories(request.GetCursorArgumentPrefix(),
-                         request.GetMatches(), Resolver);
+  return DiskFilesOrDirectories(request, /*only_dirs*/ true);
 }
 
 int CommandCompletions::DiskDirectories(const llvm::Twine &partial_file_name,
@@ -267,7 +272,7 @@ int CommandCompletions::Modules(CommandInterpreter &in
   } else {
     completer.DoCompletion(searcher);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 int CommandCompletions::Symbols(CommandInterpreter &interpreter,
@@ -283,7 +288,7 @@ int CommandCompletions::Symbols(CommandInterpreter &in
   } else {
     completer.DoCompletion(searcher);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 int CommandCompletions::SettingsNames(CommandInterpreter &interpreter,
@@ -304,20 +309,23 @@ int CommandCompletions::SettingsNames(CommandInterpret
   }
 
   size_t exact_matches_idx = SIZE_MAX;
-  const size_t num_matches =
-      g_property_names.AutoComplete(request.GetCursorArgumentPrefix(),
-                                    request.GetMatches(), exact_matches_idx);
+  StringList matches;
+  g_property_names.AutoComplete(request.GetCursorArgumentPrefix(), matches,
+                                exact_matches_idx);
   request.SetWordComplete(exact_matches_idx != SIZE_MAX);
-  return num_matches;
+  request.AddCompletions(matches);
+  return request.GetNumberOfMatches();
 }
 
 int CommandCompletions::PlatformPluginNames(CommandInterpreter &interpreter,
                                             CompletionRequest &request,
                                             SearchFilter *searcher) {
-  const uint32_t num_matches = PluginManager::AutoCompletePlatformName(
-      request.GetCursorArgumentPrefix(), request.GetMatches());
+  StringList new_matches;
+  std::size_t num_matches = PluginManager::AutoCompletePlatformName(
+      request.GetCursorArgumentPrefix(), new_matches);
   request.SetWordComplete(num_matches == 1);
-  return num_matches;
+  request.AddCompletions(new_matches);
+  return request.GetNumberOfMatches();
 }
 
 int CommandCompletions::ArchitectureNames(CommandInterpreter &interpreter,
@@ -409,10 +417,10 @@ CommandCompletions::SourceFileCompleter::DoCompletion(
   filter->Search(*this);
   // Now convert the filelist to completions:
   for (size_t i = 0; i < m_matching_files.GetSize(); i++) {
-    m_request.GetMatches().AppendString(
+    m_request.AddCompletion(
         m_matching_files.GetFileSpecAtIndex(i).GetFilename().GetCString());
   }
-  return m_request.GetMatches().GetSize();
+  return m_request.GetNumberOfMatches();
 }
 
 //----------------------------------------------------------------------
@@ -478,9 +486,9 @@ size_t CommandCompletions::SymbolCompleter::DoCompleti
   filter->Search(*this);
   collection::iterator pos = m_match_set.begin(), end = m_match_set.end();
   for (pos = m_match_set.begin(); pos != end; pos++)
-    m_request.GetMatches().AppendString((*pos).GetCString());
+    m_request.AddCompletion((*pos).GetCString());
 
-  return m_request.GetMatches().GetSize();
+  return m_request.GetNumberOfMatches();
 }
 
 //----------------------------------------------------------------------
@@ -517,7 +525,7 @@ Searcher::CallbackReturn CommandCompletions::ModuleCom
       match = false;
 
     if (match) {
-      m_request.GetMatches().AppendString(cur_file_name);
+      m_request.AddCompletion(cur_file_name);
     }
   }
   return Searcher::eCallbackReturnContinue;
@@ -525,5 +533,5 @@ Searcher::CallbackReturn CommandCompletions::ModuleCom
 
 size_t CommandCompletions::ModuleCompleter::DoCompletion(SearchFilter *filter) {
   filter->Search(*this);
-  return m_request.GetMatches().GetSize();
+  return m_request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -241,7 +241,7 @@ class CommandObjectCommandsSource : public CommandObje
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
   Options *GetOptions() override { return &m_options; }
@@ -1429,7 +1429,7 @@ class CommandObjectCommandsScriptImport : public Comma
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
   Options *GetOptions() override { return &m_options; }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -470,7 +470,7 @@ class CommandObjectFrameVariable : public CommandObjec
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eVariablePathCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -143,7 +143,7 @@ bool CommandObjectMultiword::Execute(const char *args_
 
   if (num_subcmd_matches > 0) {
     error_msg.append(" Possible completions:");
-    for (size_t i = 0; i < num_subcmd_matches; i++) {
+    for (size_t i = 0; i < matches.GetSize(); i++) {
       error_msg.append("\n\t");
       error_msg.append(matches.GetStringAtIndex(i));
     }
@@ -190,21 +190,22 @@ int CommandObjectMultiword::HandleCompletion(Completio
   // Any of the command matches will provide a complete word, otherwise the
   // individual completers will override this.
   request.SetWordComplete(true);
-  auto &matches = request.GetMatches();
 
   auto arg0 = request.GetParsedLine()[0].ref;
   if (request.GetCursorIndex() == 0) {
-    AddNamesMatchingPartialString(m_subcommand_dict, arg0, matches);
+    StringList new_matches;
+    AddNamesMatchingPartialString(m_subcommand_dict, arg0, new_matches);
+    request.AddCompletions(new_matches);
 
-    if (matches.GetSize() == 1 && matches.GetStringAtIndex(0) != nullptr &&
-        (arg0 == matches.GetStringAtIndex(0))) {
+    if (new_matches.GetSize() == 1 &&
+        new_matches.GetStringAtIndex(0) != nullptr &&
+        (arg0 == new_matches.GetStringAtIndex(0))) {
       StringList temp_matches;
       CommandObject *cmd_obj = GetSubcommandObject(arg0, &temp_matches);
       if (cmd_obj != nullptr) {
         if (request.GetParsedLine().GetArgumentCount() == 1) {
           request.SetWordComplete(true);
         } else {
-          matches.DeleteStringAtIndex(0);
           request.GetParsedLine().Shift();
           request.SetCursorCharPosition(0);
           request.GetParsedLine().AppendArgument(llvm::StringRef());
@@ -212,14 +213,17 @@ int CommandObjectMultiword::HandleCompletion(Completio
         }
       }
     }
-    return matches.GetSize();
+    return new_matches.GetSize();
   } else {
-    CommandObject *sub_command_object = GetSubcommandObject(arg0, &matches);
+    StringList new_matches;
+    CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches);
     if (sub_command_object == nullptr) {
-      return matches.GetSize();
+      request.AddCompletions(new_matches);
+      return request.GetNumberOfMatches();
     } else {
       // Remove the one match that we got from calling GetSubcommandObject.
-      matches.DeleteStringAtIndex(0);
+      new_matches.DeleteStringAtIndex(0);
+      request.AddCompletions(new_matches);
       request.GetParsedLine().Shift();
       request.SetCursorIndex(request.GetCursorIndex() - 1);
       return sub_command_object->HandleCompletion(request);
@@ -366,7 +370,6 @@ int CommandObjectProxy::HandleCompletion(CompletionReq
   CommandObject *proxy_command = GetProxyCommandObject();
   if (proxy_command)
     return proxy_command->HandleCompletion(request);
-  request.GetMatches().Clear();
   return 0;
 }
 
@@ -375,7 +378,6 @@ int CommandObjectProxy::HandleArgumentCompletion(
   CommandObject *proxy_command = GetProxyCommandObject();
   if (proxy_command)
     return proxy_command->HandleArgumentCompletion(request, opt_element_vector);
-  request.GetMatches().Clear();
   return 0;
 }
 

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlatform.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -181,7 +181,7 @@ class CommandObjectPlatformSelect : public CommandObje
   int HandleCompletion(CompletionRequest &request) override {
     CommandCompletions::PlatformPluginNames(GetCommandInterpreter(), request,
                                             nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
   Options *GetOptions() override { return &m_option_group; }
@@ -1583,9 +1583,9 @@ class CommandObjectPlatformProcessAttach : public Comm
           const uint32_t num_matches = process_infos.GetSize();
           if (num_matches > 0) {
             for (uint32_t i = 0; i < num_matches; ++i) {
-              request.GetMatches().AppendString(
+              request.AddCompletion(llvm::StringRef(
                   process_infos.GetProcessNameAtIndex(i),
-                  process_infos.GetProcessNameLengthAtIndex(i));
+                  process_infos.GetProcessNameLengthAtIndex(i)));
             }
           }
         }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectPlugin.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -48,7 +48,7 @@ class CommandObjectPluginLoad : public CommandObjectPa
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -141,7 +141,7 @@ class CommandObjectProcessLaunch : public CommandObjec
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
   Options *GetOptions() override { return &m_options; }
@@ -410,9 +410,9 @@ class CommandObjectProcessAttach : public CommandObjec
           const size_t num_matches = process_infos.GetSize();
           if (num_matches > 0) {
             for (size_t i = 0; i < num_matches; ++i) {
-              request.GetMatches().AppendString(
+              request.AddCompletion(llvm::StringRef(
                   process_infos.GetProcessNameAtIndex(i),
-                  process_infos.GetProcessNameLengthAtIndex(i));
+                  process_infos.GetProcessNameLengthAtIndex(i)));
             }
           }
         }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -172,7 +172,7 @@ insert-before or insert-after.");
         }
       }
     }
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -272,7 +272,7 @@ class CommandObjectSettingsShow : public CommandObject
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -338,7 +338,7 @@ class CommandObjectSettingsList : public CommandObject
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -427,7 +427,7 @@ class CommandObjectSettingsRemove : public CommandObje
       CommandCompletions::InvokeCommonCompletionCallbacks(
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -544,7 +544,7 @@ class CommandObjectSettingsReplace : public CommandObj
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
 
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -644,7 +644,7 @@ class CommandObjectSettingsInsertBefore : public Comma
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
 
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -749,7 +749,7 @@ class CommandObjectSettingsInsertAfter : public Comman
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
 
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -843,7 +843,7 @@ class CommandObjectSettingsAppend : public CommandObje
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
 
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -924,7 +924,7 @@ class CommandObjectSettingsClear : public CommandObjec
           GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
           request, nullptr);
 
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -201,7 +201,7 @@ class CommandObjectTargetCreate : public CommandObject
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -1810,7 +1810,7 @@ class CommandObjectTargetModulesModuleAutoComplete (pu
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eModuleCompletion, request,
         nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 };
 
@@ -1851,7 +1851,7 @@ class CommandObjectTargetModulesSourceFileAutoComplete
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eSourceFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 };
 
@@ -2393,7 +2393,7 @@ class CommandObjectTargetModulesAdd : public CommandOb
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
 protected:
@@ -3987,7 +3987,7 @@ class CommandObjectTargetSymbolsAdd : public CommandOb
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
         request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   }
 
   Options *GetOptions() override { return &m_option_group; }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Core/FormatEntity.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -2350,7 +2350,6 @@ size_t FormatEntity::AutoComplete(CompletionRequest &r
 
   request.SetWordComplete(false);
   str = str.drop_front(request.GetMatchStartPoint());
-  request.GetMatches().Clear();
 
   const size_t dollar_pos = str.rfind('$');
   if (dollar_pos == llvm::StringRef::npos)
@@ -2360,7 +2359,7 @@ size_t FormatEntity::AutoComplete(CompletionRequest &r
   if (dollar_pos == str.size() - 1) {
     std::string match = str.str();
     match.append("{");
-    request.GetMatches().AppendString(match);
+    request.AddCompletion(match);
     return 1;
   }
 
@@ -2378,8 +2377,10 @@ size_t FormatEntity::AutoComplete(CompletionRequest &r
   llvm::StringRef partial_variable(str.substr(dollar_pos + 2));
   if (partial_variable.empty()) {
     // Suggest all top level entites as we are just past "${"
-    AddMatches(&g_root, str, llvm::StringRef(), request.GetMatches());
-    return request.GetMatches().GetSize();
+    StringList new_matches;
+    AddMatches(&g_root, str, llvm::StringRef(), new_matches);
+    request.AddCompletions(new_matches);
+    return request.GetNumberOfMatches();
   }
 
   // We have a partially specified variable, find it
@@ -2395,19 +2396,23 @@ size_t FormatEntity::AutoComplete(CompletionRequest &r
     // Exact match
     if (n > 0) {
       // "${thread.info" <TAB>
-      request.GetMatches().AppendString(MakeMatch(str, "."));
+      request.AddCompletion(MakeMatch(str, "."));
     } else {
       // "${thread.id" <TAB>
-      request.GetMatches().AppendString(MakeMatch(str, "}"));
+      request.AddCompletion(MakeMatch(str, "}"));
       request.SetWordComplete(true);
     }
   } else if (remainder.equals(".")) {
     // "${thread." <TAB>
-    AddMatches(entry_def, str, llvm::StringRef(), request.GetMatches());
+    StringList new_matches;
+    AddMatches(entry_def, str, llvm::StringRef(), new_matches);
+    request.AddCompletions(new_matches);
   } else {
     // We have a partial match
     // "${thre" <TAB>
-    AddMatches(entry_def, str, remainder, request.GetMatches());
+    StringList new_matches;
+    AddMatches(entry_def, str, remainder, new_matches);
+    request.AddCompletions(new_matches);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -245,10 +245,10 @@ int IOHandlerDelegate::IOHandlerComplete(IOHandler &io
         io_handler.GetDebugger().GetCommandInterpreter(),
         CommandCompletions::eVariablePathCompletion, request, nullptr);
 
-    size_t num_matches = request.GetMatches().GetSize();
+    size_t num_matches = request.GetNumberOfMatches();
     if (num_matches > 0) {
       std::string common_prefix;
-      request.GetMatches().LongestCommonPrefix(common_prefix);
+      matches.LongestCommonPrefix(common_prefix);
       const size_t partial_name_len = request.GetCursorArgumentPrefix().size();
 
       // If we matched a unique single command, add a space... Only do this if

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -478,7 +478,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_ap(
       new CommandObjectRegexCommand(
           *this, "_regexp-break",
-          "Set a breakpoint using one of several shorthand formats.\n",
+          "Set a breakpoint using one of several shorthand formats.",
           "\n"
           "_regexp-break <filename>:<linenum>\n"
           "              main.c:12             // Break at line 12 of "
@@ -527,7 +527,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   std::unique_ptr<CommandObjectRegexCommand> tbreak_regex_cmd_ap(
       new CommandObjectRegexCommand(
           *this, "_regexp-tbreak",
-          "Set a one-shot breakpoint using one of several shorthand formats.\n",
+          "Set a one-shot breakpoint using one of several shorthand formats.",
           "\n"
           "_regexp-break <filename>:<linenum>\n"
           "              main.c:12             // Break at line 12 of "
@@ -1703,7 +1703,6 @@ bool CommandInterpreter::HandleCommand(const char *com
 }
 
 int CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) {
-  auto &matches = request.GetMatches();
   int num_command_matches = 0;
   bool look_for_subcommand = false;
 
@@ -1713,30 +1712,34 @@ int CommandInterpreter::HandleCompletionMatches(Comple
   if (request.GetCursorIndex() == -1) {
     // We got nothing on the command line, so return the list of commands
     bool include_aliases = true;
+    StringList new_matches;
     num_command_matches =
-        GetCommandNamesMatchingPartialString("", include_aliases, matches);
+        GetCommandNamesMatchingPartialString("", include_aliases, new_matches);
+    request.AddCompletions(new_matches);
   } else if (request.GetCursorIndex() == 0) {
     // The cursor is in the first argument, so just do a lookup in the
     // dictionary.
+    StringList new_matches;
     CommandObject *cmd_obj = GetCommandObject(
-        request.GetParsedLine().GetArgumentAtIndex(0), &matches);
-    num_command_matches = matches.GetSize();
+        request.GetParsedLine().GetArgumentAtIndex(0), &new_matches);
 
     if (num_command_matches == 1 && cmd_obj && cmd_obj->IsMultiwordObject() &&
-        matches.GetStringAtIndex(0) != nullptr &&
+        new_matches.GetStringAtIndex(0) != nullptr &&
         strcmp(request.GetParsedLine().GetArgumentAtIndex(0),
-               matches.GetStringAtIndex(0)) == 0) {
+               new_matches.GetStringAtIndex(0)) == 0) {
       if (request.GetParsedLine().GetArgumentCount() == 1) {
         request.SetWordComplete(true);
       } else {
         look_for_subcommand = true;
         num_command_matches = 0;
-        matches.DeleteStringAtIndex(0);
+        new_matches.DeleteStringAtIndex(0);
         request.GetParsedLine().AppendArgument(llvm::StringRef());
         request.SetCursorIndex(request.GetCursorIndex() + 1);
         request.SetCursorCharPosition(0);
       }
     }
+    request.AddCompletions(new_matches);
+    num_command_matches = request.GetNumberOfMatches();
   }
 
   if (request.GetCursorIndex() > 0 || look_for_subcommand) {
@@ -1773,8 +1776,7 @@ int CommandInterpreter::HandleCompletion(
       return 0;
     else if (first_arg[0] == CommandHistory::g_repeat_char) {
       if (auto hist_str = m_command_history.FindString(first_arg)) {
-        request.GetMatches().Clear();
-        request.GetMatches().InsertStringAtIndex(0, *hist_str);
+        matches.InsertStringAtIndex(0, *hist_str);
         return -2;
       } else
         return 0;
@@ -1812,7 +1814,7 @@ int CommandInterpreter::HandleCompletion(
         common_prefix.push_back(quote_char);
       common_prefix.push_back(' ');
     }
-    request.GetMatches().InsertStringAtIndex(0, common_prefix.c_str());
+    matches.InsertStringAtIndex(0, common_prefix.c_str());
   }
   return num_command_matches;
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -267,7 +267,6 @@ int CommandObject::HandleCompletion(CompletionRequest 
   if (WantsRawCommandString() && !WantsCompletion()) {
     // FIXME: Abstract telling the completion to insert the completion
     // character.
-    request.GetMatches().Clear();
     return -1;
   } else {
     // Can we do anything generic with the options?
@@ -282,7 +281,7 @@ int CommandObject::HandleCompletion(CompletionRequest 
       bool handled_by_options = cur_options->HandleOptionCompletion(
           request, opt_element_vector, GetCommandInterpreter());
       if (handled_by_options)
-        return request.GetMatches().GetSize();
+        return request.GetNumberOfMatches();
     }
 
     // If we got here, the last word is not an option or an option argument.

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObjectRegexCommand.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/CommandObjectRegexCommand.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -97,9 +97,8 @@ int CommandObjectRegexCommand::HandleCompletion(Comple
   if (m_completion_type_mask) {
     CommandCompletions::InvokeCommonCompletionCallbacks(
         GetCommandInterpreter(), m_completion_type_mask, request, nullptr);
-    return request.GetMatches().GetSize();
+    return request.GetNumberOfMatches();
   } else {
-    request.GetMatches().Clear();
     request.SetWordComplete(false);
   }
   return 0;

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValue.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValue.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValue.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -575,8 +575,7 @@ bool OptionValue::DumpQualifiedName(Stream &strm) cons
 size_t OptionValue::AutoComplete(CommandInterpreter &interpreter,
                                  CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 Status OptionValue::SetValueFromString(llvm::StringRef value,

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueArch.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueArch.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueArch.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -76,9 +76,8 @@ lldb::OptionValueSP OptionValueArch::DeepCopy() const 
 size_t OptionValueArch::AutoComplete(CommandInterpreter &interpreter,
                                      CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
   CommandCompletions::InvokeCommonCompletionCallbacks(
       interpreter, CommandCompletions::eArchitectureCompletion, request,
       nullptr);
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueBoolean.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueBoolean.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueBoolean.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -79,7 +79,6 @@ lldb::OptionValueSP OptionValueBoolean::DeepCopy() con
 size_t OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter,
                                         CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
   static const llvm::StringRef g_autocomplete_entries[] = {
       "true", "false", "on", "off", "yes", "no", "1", "0"};
 
@@ -91,7 +90,7 @@ size_t OptionValueBoolean::AutoComplete(CommandInterpr
 
   for (auto entry : entries) {
     if (entry.startswith_lower(request.GetCursorArgumentPrefix()))
-      request.GetMatches().AppendString(entry);
+      request.AddCompletion(entry);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueEnumeration.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueEnumeration.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueEnumeration.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -112,20 +112,18 @@ lldb::OptionValueSP OptionValueEnumeration::DeepCopy()
 size_t OptionValueEnumeration::AutoComplete(CommandInterpreter &interpreter,
                                             CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
 
   const uint32_t num_enumerators = m_enumerations.GetSize();
   if (!request.GetCursorArgumentPrefix().empty()) {
     for (size_t i = 0; i < num_enumerators; ++i) {
       llvm::StringRef name = m_enumerations.GetCStringAtIndex(i).GetStringRef();
       if (name.startswith(request.GetCursorArgumentPrefix()))
-        request.GetMatches().AppendString(name);
+        request.AddCompletion(name);
     }
   } else {
     // only suggest "true" or "false" by default
     for (size_t i = 0; i < num_enumerators; ++i)
-      request.GetMatches().AppendString(
-          m_enumerations.GetCStringAtIndex(i).GetStringRef());
+      request.AddCompletion(m_enumerations.GetCStringAtIndex(i).GetStringRef());
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -102,10 +102,9 @@ lldb::OptionValueSP OptionValueFileSpec::DeepCopy() co
 size_t OptionValueFileSpec::AutoComplete(CommandInterpreter &interpreter,
                                          CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
   CommandCompletions::InvokeCommonCompletionCallbacks(
       interpreter, m_completion_mask, request, nullptr);
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 const lldb::DataBufferSP &OptionValueFileSpec::GetFileContents() {

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueUUID.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueUUID.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/OptionValueUUID.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -70,7 +70,6 @@ lldb::OptionValueSP OptionValueUUID::DeepCopy() const 
 size_t OptionValueUUID::AutoComplete(CommandInterpreter &interpreter,
                                      CompletionRequest &request) {
   request.SetWordComplete(false);
-  request.GetMatches().Clear();
   ExecutionContext exe_ctx(interpreter.GetExecutionContext());
   Target *target = exe_ctx.GetTargetPtr();
   if (target) {
@@ -86,12 +85,12 @@ size_t OptionValueUUID::AutoComplete(CommandInterprete
             llvm::ArrayRef<uint8_t> module_bytes = module_uuid.GetBytes();
             if (module_bytes.size() >= uuid_bytes.size() &&
                 module_bytes.take_front(uuid_bytes.size()).equals(uuid_bytes)) {
-              request.GetMatches().AppendString(module_uuid.GetAsString());
+              request.AddCompletion(module_uuid.GetAsString());
             }
           }
         }
       }
     }
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -680,7 +680,7 @@ bool Options::HandleOptionCompletion(CompletionRequest
           if (!def.short_option)
             continue;
           opt_str[1] = def.short_option;
-          request.GetMatches().AppendString(opt_str);
+          request.AddCompletion(opt_str);
         }
 
         return true;
@@ -692,7 +692,7 @@ bool Options::HandleOptionCompletion(CompletionRequest
 
           full_name.erase(full_name.begin() + 2, full_name.end());
           full_name.append(def.long_option);
-          request.GetMatches().AppendString(full_name.c_str());
+          request.AddCompletion(full_name.c_str());
         }
         return true;
       } else if (opt_defs_index != OptionArgElement::eUnrecognizedArg) {
@@ -705,10 +705,10 @@ bool Options::HandleOptionCompletion(CompletionRequest
             strcmp(opt_defs[opt_defs_index].long_option, cur_opt_str) != 0) {
           std::string full_name("--");
           full_name.append(opt_defs[opt_defs_index].long_option);
-          request.GetMatches().AppendString(full_name.c_str());
+          request.AddCompletion(full_name.c_str());
           return true;
         } else {
-          request.GetMatches().AppendString(request.GetCursorArgument());
+          request.AddCompletion(request.GetCursorArgument());
           return true;
         }
       } else {
@@ -728,17 +728,7 @@ bool Options::HandleOptionCompletion(CompletionRequest
             if (strstr(def.long_option, cur_opt_str + 2) == def.long_option) {
               std::string full_name("--");
               full_name.append(def.long_option);
-              // The options definitions table has duplicates because of the
-              // way the grouping information is stored, so only add once.
-              bool duplicate = false;
-              for (size_t k = 0; k < request.GetMatches().GetSize(); k++) {
-                if (request.GetMatches().GetStringAtIndex(k) == full_name) {
-                  duplicate = true;
-                  break;
-                }
-              }
-              if (!duplicate)
-                request.GetMatches().AppendString(full_name.c_str());
+              request.AddCompletion(full_name.c_str());
             }
           }
         }
@@ -790,7 +780,7 @@ bool Options::HandleOptionArgumentCompletion(
     for (int i = 0; enum_values[i].string_value != nullptr; i++) {
       if (strstr(enum_values[i].string_value, match_string.c_str()) ==
           enum_values[i].string_value) {
-        request.GetMatches().AppendString(enum_values[i].string_value);
+        request.AddCompletion(enum_values[i].string_value);
         return_value = true;
       }
     }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h	Thu Aug  2 18:02:18 2018	(r337152)
@@ -13,8 +13,6 @@
 #include "DWARFUnit.h"
 
 class DWARFCompileUnit : public DWARFUnit {
-  friend class DWARFUnit;
-
 public:
   static DWARFUnitSP Extract(SymbolFileDWARF *dwarf2Data,
                              const lldb_private::DWARFDataExtractor &debug_info,

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h	Thu Aug  2 18:02:18 2018	(r337152)
@@ -33,8 +33,6 @@ enum DWARFProducer {
 };
 
 class DWARFUnit {
-  friend class DWARFCompileUnit;
-
   using die_iterator_range =
       llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>;
 

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -644,11 +644,12 @@ static void PrivateAutoComplete(
       break;
 
     case '-':
-      if (partial_path[1] == '>' && !prefix_path.str().empty()) {
+      if (partial_path.size() > 1 && partial_path[1] == '>' &&
+          !prefix_path.str().empty()) {
         switch (type_class) {
         case lldb::eTypeClassPointer: {
           CompilerType pointee_type(compiler_type.GetPointeeType());
-          if (partial_path[2]) {
+          if (partial_path.size() > 2 && partial_path[2]) {
             // If there is more after the "->", then search deeper
             PrivateAutoComplete(
                 frame, partial_path.substr(2), prefix_path + "->",
@@ -672,7 +673,7 @@ static void PrivateAutoComplete(
         case lldb::eTypeClassUnion:
         case lldb::eTypeClassStruct:
         case lldb::eTypeClassClass:
-          if (partial_path[1]) {
+          if (partial_path.size() > 1 && partial_path[1]) {
             // If there is more after the ".", then search deeper
             PrivateAutoComplete(frame, partial_path.substr(1),
                                 prefix_path + ".", compiler_type, matches,
@@ -760,9 +761,11 @@ size_t Variable::AutoComplete(const ExecutionContext &
   CompilerType compiler_type;
 
   bool word_complete = false;
+  StringList matches;
   PrivateAutoComplete(exe_ctx.GetFramePtr(), request.GetCursorArgumentPrefix(),
-                      "", compiler_type, request.GetMatches(), word_complete);
+                      "", compiler_type, matches, word_complete);
   request.SetWordComplete(word_complete);
+  request.AddCompletions(matches);
 
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/ArchSpec.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -255,12 +255,14 @@ size_t ArchSpec::AutoComplete(CompletionRequest &reque
     for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) {
       if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith,
                       request.GetCursorArgumentPrefix()))
-        request.GetMatches().AppendString(g_core_definitions[i].name);
+        request.AddCompletion(g_core_definitions[i].name);
     }
   } else {
-    ListSupportedArchNames(request.GetMatches());
+    StringList matches;
+    ListSupportedArchNames(matches);
+    request.AddCompletions(matches);
   }
-  return request.GetMatches().GetSize();
+  return request.GetNumberOfMatches();
 }
 
 #define CPU_ANY (UINT32_MAX)

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/CompletionRequest.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/CompletionRequest.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/CompletionRequest.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -20,6 +20,7 @@ CompletionRequest::CompletionRequest(llvm::StringRef c
     : m_command(command_line), m_raw_cursor_pos(raw_cursor_pos),
       m_match_start_point(match_start_point),
       m_max_return_elements(max_return_elements), m_matches(&matches) {
+  matches.Clear();
 
   // We parse the argument up to the cursor, so the last argument in
   // parsed_line is the one containing the cursor, and the cursor is after the

Modified: projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/Stream.cpp
==============================================================================
--- projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/Stream.cpp	Thu Aug  2 18:01:17 2018	(r337151)
+++ projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/Stream.cpp	Thu Aug  2 18:02:18 2018	(r337152)
@@ -526,48 +526,3 @@ size_t Stream::PutCStringAsRawHex8(const char *s) {
     m_flags.Set(eBinary);
   return bytes_written;
 }
-
-void Stream::UnitTest(Stream *s) {
-  s->PutHex8(0x12);
-
-  s->PutChar(' ');
-  s->PutHex16(0x3456, endian::InlHostByteOrder());
-  s->PutChar(' ');
-  s->PutHex16(0x3456, eByteOrderBig);
-  s->PutChar(' ');
-  s->PutHex16(0x3456, eByteOrderLittle);
-
-  s->PutChar(' ');

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808021802.w72I2JQc044399>