Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 21:23:35 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r327310 - in vendor/lldb/dist: source/Plugins/SymbolFile/PDB unittests/SymbolFile/PDB
Message-ID:  <201712282123.vBSLNZ67024657@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Dec 28 21:23:35 2017
New Revision: 327310
URL: https://svnweb.freebsd.org/changeset/base/327310

Log:
  Vendor import of lldb trunk r321530:
  https://llvm.org/svn/llvm-project/lldb/trunk@321530

Modified:
  vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
==============================================================================
--- vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h	Thu Dec 28 21:23:32 2017	(r327309)
+++ vendor/lldb/dist/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h	Thu Dec 28 21:23:35 2017	(r327310)
@@ -140,6 +140,10 @@ class SymbolFilePDB : public lldb_private::SymbolFile 
   size_t FindTypes(const std::vector<lldb_private::CompilerContext> &context,
                    bool append, lldb_private::TypeMap &types) override;
 
+  void FindTypesByRegex(const lldb_private::RegularExpression &regex,
+                        uint32_t max_matches,
+                        lldb_private::TypeMap &types);
+
   lldb_private::TypeList *GetTypeList() override;
 
   size_t GetTypes(lldb_private::SymbolContextScope *sc_scope,
@@ -171,10 +175,6 @@ class SymbolFilePDB : public lldb_private::SymbolFile 
   void BuildSupportFileIdToSupportFileIndexMap(
       const llvm::pdb::PDBSymbolCompiland &cu,
       llvm::DenseMap<uint32_t, uint32_t> &index_map) const;
-
-  void FindTypesByRegex(const lldb_private::RegularExpression &regex,
-                        uint32_t max_matches,
-                        lldb_private::TypeMap &types);
 
   void FindTypesByName(const std::string &name, uint32_t max_matches,
                        lldb_private::TypeMap &types);

Modified: vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
==============================================================================
--- vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp	Thu Dec 28 21:23:32 2017	(r327309)
+++ vendor/lldb/dist/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp	Thu Dec 28 21:23:35 2017	(r327310)
@@ -512,20 +512,15 @@ TEST_F(SymbolFilePDBTests, TestRegexNameMatch) {
   SymbolVendor *plugin = module->GetSymbolVendor();
   SymbolFilePDB *symfile =
       static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
-  SymbolContext sc;
-  llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
-  uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr,
-                                            false, 0, searched_files, results);
-  EXPECT_GT(num_results, 1u);
-  EXPECT_EQ(num_results, results.GetSize());
+   
+  symfile->FindTypesByRegex(RegularExpression(".*"), 0, results);
+  EXPECT_GT(results.GetSize(), 1u);
 
   // We expect no exception thrown if the given regex can't be compiled
   results.Clear();
-  num_results = symfile->FindTypes(sc, ConstString("**"), nullptr,
-                                   false, 0, searched_files, results);
-  EXPECT_EQ(num_results, 0u);
-  EXPECT_EQ(num_results, results.GetSize());
+  symfile->FindTypesByRegex(RegularExpression("**"), 0, results);
+  EXPECT_EQ(0u, results.GetSize());
 }
 
 TEST_F(SymbolFilePDBTests, TestMaxMatches) {
@@ -539,7 +534,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
   SymbolContext sc;
   llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
-  uint32_t num_results = symfile->FindTypes(sc, ConstString(".*"), nullptr,
+  const ConstString name("ClassTypedef");
+  uint32_t num_results = symfile->FindTypes(sc, name, nullptr,
                                             false, 0, searched_files, results);
   // Try to limit ourselves from 1 to 10 results, otherwise we could be doing
   // this thousands of times.
@@ -549,7 +545,7 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
   uint32_t iterations = std::min(num_results, 10u);
   for (uint32_t i = 1; i <= iterations; ++i) {
     uint32_t num_limited_results = symfile->FindTypes(
-        sc, ConstString(".*"), nullptr, false, i, searched_files, results);
+        sc, name, nullptr, false, i, searched_files, results);
     EXPECT_EQ(i, num_limited_results);
     EXPECT_EQ(num_limited_results, results.GetSize());
   }



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