]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use gdb unordered map for complaints
authorTom Tromey <tom@tromey.com>
Tue, 11 Mar 2025 17:19:43 +0000 (11:19 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 18 Mar 2025 11:32:03 +0000 (05:32 -0600)
This changes the complaints code to use gdb::unordered_map.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/complaints.c
gdb/complaints.h

index b50bea846790cf83fe09ae04c83c2f786f34311b..80b358c8dd165d7ed432563dea0f1a46833d30d1 100644 (file)
 #include "run-on-main-thread.h"
 #include "top.h"
 #include "gdbsupport/selftest.h"
-#include <unordered_map>
+#include "gdbsupport/unordered_map.h"
 #if CXX_STD_THREAD
 #include <mutex>
 #endif
 
 /* Map format strings to counters.  */
 
-static std::unordered_map<const char *, int> counters;
+static gdb::unordered_map<const char *, int> counters;
 
 /* How many complaints about a particular thing should be printed
    before we stop whining about it?  Default is no whining at all,
@@ -149,7 +149,7 @@ namespace selftests {
 static void
 test_complaints ()
 {
-  std::unordered_map<const char *, int> tmp;
+  gdb::unordered_map<const char *, int> tmp;
   scoped_restore reset_counters = make_scoped_restore (&counters, tmp);
   scoped_restore reset_stop_whining = make_scoped_restore (&stop_whining, 2);
 
index 3d0e0babd836a667134edf4b6ecb22a5b3d53490..20650671404be9988a0b58a976d1b1aad6e83045 100644 (file)
@@ -21,7 +21,7 @@
 #define GDB_COMPLAINTS_H
 
 #include "gdbsupport/scoped_restore.h"
-#include <unordered_set>
+#include "gdbsupport/unordered_set.h"
 
 /* Helper for complaint.  */
 extern void complaint_internal (const char *fmt, ...)
@@ -59,7 +59,7 @@ extern void clear_complaints ();
 
 /* Type of collected complaints.  */
 
-typedef std::unordered_set<std::string> complaint_collection;
+typedef gdb::unordered_set<std::string> complaint_collection;
 
 /* A class that can handle calls to complaint from multiple threads.
    When this is instantiated, it hooks into the complaint mechanism,