[Lldb-commits] [lldb] r363438 - Remove stale comment and disabled code (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 14 11:12:55 PDT 2019


Author: jdevlieghere
Date: Fri Jun 14 11:12:55 2019
New Revision: 363438

URL: http://llvm.org/viewvc/llvm-project?rev=363438&view=rev
Log:
Remove stale comment and disabled code (NFC)

Modified:
    lldb/trunk/source/Symbol/Symtab.cpp

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=363438&r1=363437&r2=363438&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Fri Jun 14 11:12:55 2019
@@ -216,7 +216,6 @@ const Symbol *Symtab::SymbolAtIndex(size
   return nullptr;
 }
 
-// InitNameIndexes
 static bool lldb_skip_name(llvm::StringRef mangled,
                            Mangled::ManglingScheme scheme) {
   switch (scheme) {
@@ -259,25 +258,7 @@ void Symtab::InitNameIndexes() {
     Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
     // Create the name index vector to be able to quickly search by name
     const size_t num_symbols = m_symbols.size();
-#if 1
     m_name_to_index.Reserve(num_symbols);
-#else
-    // TODO: benchmark this to see if we save any memory. Otherwise we
-    // will always keep the memory reserved in the vector unless we pull some
-    // STL swap magic and then recopy...
-    uint32_t actual_count = 0;
-    for (const_iterator pos = m_symbols.begin(), end = m_symbols.end();
-         pos != end; ++pos) {
-      const Mangled &mangled = pos->GetMangled();
-      if (mangled.GetMangledName())
-        ++actual_count;
-
-      if (mangled.GetDemangledName())
-        ++actual_count;
-    }
-
-    m_name_to_index.Reserve(actual_count);
-#endif
 
     // The "const char *" in "class_contexts" and backlog::value_type::second
     // must come from a ConstString::GetCString()




More information about the lldb-commits mailing list