public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Matthias Maennich <maennich@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, gprocida@google.com, kernel-team@android.com,
	 maennich@google.com
Subject: [PATCH 5/6] Remove <unordered_set> usages from abg_compat
Date: Mon, 14 Dec 2020 23:08:55 +0000	[thread overview]
Message-ID: <20201214230855.1574934-6-maennich@google.com> (raw)
In-Reply-To: <20201214230855.1574934-1-maennich@google.com>

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(-)

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;
-- 
2.29.2.684.gfbc64c5ab5-goog


  parent reply	other threads:[~2020-12-14 23:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 23:08 [PATCH 0/6] Drop C++03 compatibility layer from abg-cxx-compat.h Matthias Maennich
2020-12-14 23:08 ` [PATCH 1/6] Drop C++03 compatibility layer Matthias Maennich
2020-12-14 23:08 ` [PATCH 2/6] Remove <functional> usages from abg_compat Matthias Maennich
2020-12-14 23:08 ` [PATCH 3/6] Remove <memory> " Matthias Maennich
2020-12-14 23:08 ` [PATCH 4/6] Remove <unordered_map> " Matthias Maennich
2020-12-14 23:08 ` Matthias Maennich [this message]
2020-12-14 23:08 ` [PATCH 6/6] Drop unneccessary includes of abg-cxx-compat.h Matthias Maennich
2020-12-15  8:47 ` [PATCH 0/6] Drop C++03 compatibility layer from abg-cxx-compat.h 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=20201214230855.1574934-6-maennich@google.com \
    --to=maennich@google.com \
    --cc=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    /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).