[5/6] Remove <unordered_set> usages from abg_compat

Message ID 20201214230855.1574934-6-maennich@google.com
State Committed
Headers
Series Drop C++03 compatibility layer from abg-cxx-compat.h |

Commit Message

Matthias Männich Dec. 14, 2020, 11:08 p.m. UTC
  std::unordered_set is now provided through the language standard, hence
remove the compatibility code for <unordered_set> and adjust all users
accordingly.

	* include/abg-cxx-compat.h: Drop compatibility for <unordered_set>.
	* include/abg-comparison.h: migrate abg_compat use to std.
	* include/abg-interned-str.h: Likewise.
	* include/abg-suppression.h: Likewise.
	* src/abg-comparison-priv.h: Likewise.
	* src/abg-dwarf-reader.cc: Likewise.
	* tests/test-diff-suppr.cc: Likewise.
	* tools/abipkgdiff.cc: Likewise.

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 include/abg-comparison.h   | 3 ++-
 include/abg-cxx-compat.h   | 5 -----
 include/abg-interned-str.h | 3 ++-
 include/abg-suppression.h  | 4 +++-
 src/abg-comparison-priv.h  | 3 ++-
 src/abg-dwarf-reader.cc    | 3 ++-
 tests/test-diff-suppr.cc   | 3 ++-
 tools/abipkgdiff.cc        | 3 ++-
 8 files changed, 15 insertions(+), 12 deletions(-)
  

Patch

diff --git a/include/abg-comparison.h b/include/abg-comparison.h
index c9e8df7624d2..1da8215ef19e 100644
--- a/include/abg-comparison.h
+++ b/include/abg-comparison.h
@@ -12,6 +12,7 @@ 
 
 #include <ostream>
 #include <unordered_map>
+#include <unordered_set>
 #include "abg-cxx-compat.h"
 #include "abg-corpus.h"
 #include "abg-diff-utils.h"
@@ -38,7 +39,7 @@  typedef std::vector<filter_base_sptr> filters;
 using std::ostream;
 using std::vector;
 using std::unordered_map;
-using abg_compat::unordered_set;
+using std::unordered_set;
 using std::pair;
 
 using diff_utils::insertion;
diff --git a/include/abg-cxx-compat.h b/include/abg-cxx-compat.h
index fd693933d65f..838fa53707d1 100644
--- a/include/abg-cxx-compat.h
+++ b/include/abg-cxx-compat.h
@@ -8,13 +8,8 @@ 
 #ifndef __ABG_CXX_COMPAT_H
 #define __ABG_CXX_COMPAT_H
 
-#include <unordered_set>
-
 namespace abg_compat {
 
-// <unordered_set>
-using std::unordered_set;
-
 }
 
 #endif  // __ABG_CXX_COMPAT_H
diff --git a/include/abg-interned-str.h b/include/abg-interned-str.h
index ed6499090c43..bd51350edd33 100644
--- a/include/abg-interned-str.h
+++ b/include/abg-interned-str.h
@@ -20,13 +20,14 @@ 
 #include <memory>
 #include <ostream>
 #include <string>
+#include <unordered_set>
 #include "abg-cxx-compat.h"
 
 
 namespace abigail
 {
 // Inject some std types into this namespace.
-using abg_compat::unordered_set;
+using std::unordered_set;
 using std::shared_ptr;
 using std::string;
 using std::ostream;
diff --git a/include/abg-suppression.h b/include/abg-suppression.h
index dd575916068c..9c135607b42f 100644
--- a/include/abg-suppression.h
+++ b/include/abg-suppression.h
@@ -8,6 +8,8 @@ 
 #ifndef __ABG_SUPPRESSION_H__
 #define __ABG_SUPPRESSION_H__
 
+#include <unordered_set>
+
 #include "abg-cxx-compat.h"
 #include "abg-ini.h"
 #include "abg-comparison.h"
@@ -28,7 +30,7 @@  namespace suppr
 {
 
 using namespace abigail::comparison;
-using abg_compat::unordered_set;
+using std::unordered_set;
 
 /// Base type of the suppression specifications types.
 ///
diff --git a/src/abg-comparison-priv.h b/src/abg-comparison-priv.h
index 1f04f3cbb61a..7b3587d8808d 100644
--- a/src/abg-comparison-priv.h
+++ b/src/abg-comparison-priv.h
@@ -20,6 +20,7 @@ 
 #include "abg-internal.h"
 // <headers defining libabigail's API go under here>
 #include <memory>
+#include <unordered_set>
 ABG_BEGIN_EXPORT_DECLARATIONS
 
 #include "abg-hash.h"
@@ -38,7 +39,7 @@  namespace abigail
 namespace comparison
 {
 
-using abg_compat::unordered_set;
+using std::unordered_set;
 using namespace abigail::suppr;
 
 // Inject types from outside in here.
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index c3723ae15236..2e137b211e71 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -31,6 +31,7 @@ 
 #include <sstream>
 #include <stack>
 #include <unordered_map>
+#include <unordered_set>
 
 #include "abg-cxx-compat.h"
 #include "abg-ir-priv.h"
@@ -67,7 +68,7 @@  namespace dwarf_reader
 using std::dynamic_pointer_cast;
 using std::static_pointer_cast;
 using std::unordered_map;
-using abg_compat::unordered_set;
+using std::unordered_set;
 using std::stack;
 using std::deque;
 using std::list;
diff --git a/tests/test-diff-suppr.cc b/tests/test-diff-suppr.cc
index f6548d066391..0f7c448c7600 100644
--- a/tests/test-diff-suppr.cc
+++ b/tests/test-diff-suppr.cc
@@ -22,6 +22,7 @@ 
 #include <iostream>
 #include <memory>
 #include <string>
+#include <unordered_set>
 #include "abg-cxx-compat.h"
 #include "abg-tools-utils.h"
 #include "abg-workers.h"
@@ -2156,7 +2157,7 @@  main(int argc, char *argv[])
   const std::string out_base_path = std::string(get_build_dir()) + "/tests/";
 
   // output paths need to be unique to avoid collisions during parallel testing
-  abg_compat::unordered_set<std::string> out_paths;
+  std::unordered_set<std::string> out_paths;
   bool non_unique_output_paths = false;
   for (InOutSpec* s = in_out_specs; s->in_elfv0_path; ++s) {
 	if (!out_paths.insert(s->out_report_path).second) {
diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc
index 6c2c6a53bad3..3decc9205729 100644
--- a/tools/abipkgdiff.cc
+++ b/tools/abipkgdiff.cc
@@ -79,6 +79,7 @@ 
 #include <map>
 #include <memory>
 #include <string>
+#include <unordered_set>
 #include <vector>
 
 #include "abg-cxx-compat.h"
@@ -98,7 +99,7 @@  using std::ostream;
 using std::ofstream;
 using std::vector;
 using std::map;
-using abg_compat::unordered_set;
+using std::unordered_set;
 using std::set;
 using std::ostringstream;
 using std::shared_ptr;