]> sourceware.org Git - libabigail.git/commitdiff
Cleanup class_decl inifite comparison detection
authorDodji Seketeli <dodji@redhat.com>
Fri, 7 Oct 2016 13:26:30 +0000 (15:26 +0200)
committerDodji Seketeli <dodji@redhat.com>
Mon, 10 Oct 2016 10:57:12 +0000 (12:57 +0200)
We recently used a new type interned_string_set_type to detect
infinite comparison of function_type type.  This patch uses the same
type for class_decl infinite comparison detection.

* src/abg-ir.cc (environment::priv::classes_being_compared_): Make
this use the new interned_string_set_type type.
(class_decl::priv::{mark_as_being_compared, comparison_started}):
Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-ir.cc

index f421265a5701a4b45d0d0b8aee087b3b46b1820a..4fec0184287e44447d26008a0bc1fd19f57db3f2 100644 (file)
@@ -2042,7 +2042,7 @@ struct environment::priv
   canonical_types_map_type     canonical_types_;
   type_decl_sptr               void_type_decl_;
   type_decl_sptr               variadic_marker_type_decl_;
-  interned_string_bool_map_type classes_being_compared_;
+  interned_string_set_type     classes_being_compared_;
   interned_string_set_type     fn_types_being_compared_;
   vector<type_base_sptr>       extra_live_types_;
   interned_string_pool         string_pool_;
@@ -12245,7 +12245,7 @@ struct class_decl::priv
   {
     const environment* env = klass.get_environment();
     assert(env);
-    env->priv_->classes_being_compared_[klass.get_qualified_name()] = true;
+    env->priv_->classes_being_compared_.insert(klass.get_qualified_name());
   }
 
   /// Mark a class as being currently compared using the class_decl==
@@ -12318,7 +12318,7 @@ struct class_decl::priv
   {
     const environment* env = klass.get_environment();
     assert(env);
-    interned_string_bool_map_type& c = env->priv_->classes_being_compared_;
+    interned_string_set_type& c = env->priv_->classes_being_compared_;
     return (c.find(klass.get_qualified_name()) != c.end());
   }
 
This page took 0.041803 seconds and 5 git commands to generate.