[Lldb-commits] [lldb] b92c334 - Remove dead code: TypeMap::RemoveMismatchedTypes(TypeClass type_class)

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 7 13:46:21 PDT 2022


Author: David Blaikie
Date: 2022-07-07T20:46:14Z
New Revision: b92c33495aeda7d7fa7f5d3f518c59cc5785fd9f

URL: https://github.com/llvm/llvm-project/commit/b92c33495aeda7d7fa7f5d3f518c59cc5785fd9f
DIFF: https://github.com/llvm/llvm-project/commit/b92c33495aeda7d7fa7f5d3f518c59cc5785fd9f.diff

LOG: Remove dead code: TypeMap::RemoveMismatchedTypes(TypeClass type_class)

Added: 
    

Modified: 
    lldb/include/lldb/Symbol/TypeMap.h
    lldb/source/Symbol/TypeMap.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Symbol/TypeMap.h b/lldb/include/lldb/Symbol/TypeMap.h
index 064e2cc948b6..c200ccb9844f 100644
--- a/lldb/include/lldb/Symbol/TypeMap.h
+++ b/lldb/include/lldb/Symbol/TypeMap.h
@@ -53,15 +53,10 @@ class TypeMap {
 
   bool Remove(const lldb::TypeSP &type_sp);
 
-  void RemoveMismatchedTypes(llvm::StringRef qualified_typename,
-                             bool exact_match);
-
   void RemoveMismatchedTypes(llvm::StringRef type_scope,
                              llvm::StringRef type_basename,
                              lldb::TypeClass type_class, bool exact_match);
 
-  void RemoveMismatchedTypes(lldb::TypeClass type_class);
-
 private:
   typedef collection::iterator iterator;
   typedef collection::const_iterator const_iterator;

diff  --git a/lldb/source/Symbol/TypeMap.cpp b/lldb/source/Symbol/TypeMap.cpp
index 7217a29fc002..0d5f6d53e5a0 100644
--- a/lldb/source/Symbol/TypeMap.cpp
+++ b/lldb/source/Symbol/TypeMap.cpp
@@ -127,20 +127,6 @@ void TypeMap::Dump(Stream *s, bool show_context, lldb::DescriptionLevel level) {
   }
 }
 
-void TypeMap::RemoveMismatchedTypes(llvm::StringRef qualified_typename,
-                                    bool exact_match) {
-  llvm::StringRef type_scope;
-  llvm::StringRef type_basename;
-  TypeClass type_class = eTypeClassAny;
-  if (!Type::GetTypeScopeAndBasename(qualified_typename, type_scope,
-                                     type_basename, type_class)) {
-    type_basename = qualified_typename;
-    type_scope = "";
-  }
-  return RemoveMismatchedTypes(type_scope, type_basename, type_class,
-                               exact_match);
-}
-
 void TypeMap::RemoveMismatchedTypes(llvm::StringRef type_scope,
                                     llvm::StringRef type_basename,
                                     TypeClass type_class, bool exact_match) {
@@ -213,25 +199,3 @@ void TypeMap::RemoveMismatchedTypes(llvm::StringRef type_scope,
   }
   m_types.swap(matching_types);
 }
-
-void TypeMap::RemoveMismatchedTypes(TypeClass type_class) {
-  if (type_class == eTypeClassAny)
-    return;
-
-  // Our "collection" type currently is a std::map which doesn't have any good
-  // way to iterate and remove items from the map so we currently just make a
-  // new list and add all of the matching types to it, and then swap it into
-  // m_types at the end
-  collection matching_types;
-
-  iterator pos, end = m_types.end();
-
-  for (pos = m_types.begin(); pos != end; ++pos) {
-    Type *the_type = pos->second.get();
-    TypeClass match_type_class =
-        the_type->GetForwardCompilerType().GetTypeClass();
-    if (match_type_class & type_class)
-      matching_types.insert(*pos);
-  }
-  m_types.swap(matching_types);
-}


        


More information about the lldb-commits mailing list