public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com,
	 maennich@google.com
Subject: [PATCH 3/4] abg-reader.cc: Strip out WIP type tracking.
Date: Tue,  5 May 2020 19:06:11 +0100	[thread overview]
Message-ID: <20200505180612.232158-4-gprocida@google.com> (raw)
In-Reply-To: <20200505180612.232158-1-gprocida@google.com>

This functionality was needed only for early canonicalisation of types
and is now no longer used.

	* src/abg-reader.cc (read_context): Drop m_wip_types_map
	member. Drop clear_wip_classes_map, mark_type_as_wip,
	unmark_type_as_wip and is_wip_type methods.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-reader.cc | 67 -----------------------------------------------
 1 file changed, 67 deletions(-)

diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index a2bd3c5c..27bc9d51 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -119,7 +119,6 @@ private:
   unordered_map<string, vector<type_base_sptr> >	m_types_map;
   unordered_map<string, shared_ptr<function_tdecl> >	m_fn_tmpl_map;
   unordered_map<string, shared_ptr<class_tdecl> >	m_class_tmpl_map;
-  unordered_map<string, size_t>			m_wip_types_map;
   vector<type_base_sptr>				m_types_to_canonicalize;
   string_xml_node_map					m_id_xml_node_map;
   xml_node_decl_base_sptr_map				m_xml_node_decl_map;
@@ -518,66 +517,6 @@ public:
   clear_types_to_canonicalize()
   {m_types_to_canonicalize.clear();}
 
-  /// Clean the map of classes that are "Work In Progress"; that is,
-  /// the map of the class that are currently being built, but at not
-  /// yet fully built.
-  void
-  clear_wip_classes_map()
-  {m_wip_types_map.clear();}
-
-  /// Mark a given type as being "Work In Progress"; that is, mark it
-  /// as being currently built.
-  ///
-  /// @param t the class to mark as being "Work In Progress".
-  void
-  mark_type_as_wip(const type_base_sptr t)
-  {
-    if (!t)
-      return;
-    string qname = get_type_name(t, /*qualified=*/true);
-    unordered_map<string, size_t>::iterator it = m_wip_types_map.find(qname);
-    if (it == m_wip_types_map.end())
-      m_wip_types_map[qname] = 1;
-    else
-      ++it->second;
-  }
-
-  /// Mark a given class as being *NOT* "Work In Progress" anymore;
-  /// that is, mark it as being fully built.
-  ///
-  /// @param t the type to mark as being built.
-  void
-  unmark_type_as_wip(const type_base_sptr t)
-  {
-    if (!t)
-      return;
-
-    string qname = get_type_name(t, /*qualified=*/true);
-    unordered_map<string, size_t>::iterator it = m_wip_types_map.find(qname);
-    if (it == m_wip_types_map.end())
-      return;
-    if (it->second)
-      --it->second;
-    if (it->second == 0)
-      m_wip_types_map.erase(it);
-  }
-
-  /// Test if a type is being currently built; that is, if it's "Work
-  /// In Progress".
-  ///
-  /// @param t the type to consider.
-  bool
-  is_wip_type(const type_base_sptr t) const
-  {
-    if (!t)
-      return false;
-
-    string qname = get_type_name(t, /*qualified=*/true);
-    unordered_map<string, size_t>::const_iterator i =
-      m_wip_types_map.find(qname);
-    return i != m_wip_types_map.end();
-  }
-
   /// Test if two types are equal, without comparing them structurally.
   ///
   /// This either tests that type pointers are equal, or it tests
@@ -3815,7 +3754,6 @@ build_function_type(read_context&	ctxt,
 						parms, size, align));
 
   ctxt.get_translation_unit()->bind_function_type_life_time(fn_type);
-  ctxt.mark_type_as_wip(fn_type);
   ctxt.key_type_decl(fn_type, id);
 
   for (xmlNodePtr n = node->children; n ; n = n->next)
@@ -3842,7 +3780,6 @@ build_function_type(read_context&	ctxt,
     }
 
   fn_type->set_parameters(parms);
-  ctxt.unmark_type_as_wip(fn_type);
 
   return fn_type;
 }
@@ -4538,7 +4475,6 @@ build_class_decl(read_context&		ctxt,
   ctxt.push_decl_to_current_scope(decl, add_to_current_scope);
 
   ctxt.map_xml_node_to_decl(node, decl);
-  ctxt.mark_type_as_wip(decl);
   ctxt.key_type_decl(decl, id);
 
   // If this class has a naming typedef, get it and refer to it.
@@ -4762,7 +4698,6 @@ build_class_decl(read_context&		ctxt,
     }
 
   ctxt.pop_scope_or_abort(decl);
-  ctxt.unmark_type_as_wip(decl);
 
   return decl;
 }
@@ -4945,7 +4880,6 @@ build_union_decl(read_context& ctxt,
   ctxt.push_decl_to_current_scope(decl, add_to_current_scope);
 
   ctxt.map_xml_node_to_decl(node, decl);
-  ctxt.mark_type_as_wip(decl);
   ctxt.key_type_decl(decl, id);
 
   for (xmlNodePtr n = node->children; !is_decl_only && n; n = n->next)
@@ -5097,7 +5031,6 @@ build_union_decl(read_context& ctxt,
     }
 
   ctxt.pop_scope_or_abort(decl);
-  ctxt.unmark_type_as_wip(decl);
 
   return decl;
 }
-- 
2.26.2.526.g744177e7f7-goog


  parent reply	other threads:[~2020-05-05 18:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 18:06 [PATCH 0/4] Fix incomplete function type bug in abg-reader Giuliano Procida
2020-05-05 18:06 ` [PATCH 1/4] Add XML reader test for incomplete function types Giuliano Procida
2020-05-12 16:22   ` Matthias Maennich
2020-05-13 18:39     ` Giuliano Procida
2020-05-05 18:06 ` [PATCH 2/4] abg-reader.cc: Late canonicalise all types Giuliano Procida
2020-05-05 18:06 ` Giuliano Procida [this message]
2020-05-05 18:06 ` [PATCH 4/4] Pass bind_function_type_life_time a complete type Giuliano Procida
2020-05-13 14:38 ` [PATCH 0/4] Fix incomplete function type bug in abg-reader Dodji Seketeli
2020-05-13 18:30   ` Giuliano Procida
2020-05-14  8:14     ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200505180612.232158-4-gprocida@google.com \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).