@@ -25,6 +25,8 @@
#include <algorithm>
+namespace gdb {
+
/* The type used to hold a single bcache string. The user data is
stored in d.data. Since it can be any type, it needs to have the
same alignment as the most strict alignment of any type on the host
@@ -403,3 +405,5 @@ bcache::memory_used ()
return 0;
return obstack_memory_used (&m_cache);
}
+
+} /* namespace gdb */
@@ -136,6 +136,8 @@
*/
+namespace gdb {
+
struct bstring;
/* The hash functions */
@@ -221,4 +223,6 @@ private:
void expand_hash_table ();
};
+} /* namespace gdb */
+
#endif /* BCACHE_H */
@@ -3783,7 +3783,7 @@ check_types_equal (struct type *type1, struct type *type2,
static bool
check_types_worklist (std::vector<type_equality_entry> *worklist,
- struct bcache *cache)
+ gdb::bcache *cache)
{
while (!worklist->empty ())
{
@@ -3819,7 +3819,7 @@ types_deeply_equal (struct type *type1, struct type *type2)
if (type1 == type2)
return true;
- struct bcache cache (nullptr, nullptr);
+ gdb::bcache cache (nullptr, nullptr);
worklist.emplace_back (type1, type2);
return check_types_worklist (&worklist, &cache);
}
@@ -40,7 +40,7 @@ struct macro_table
/* The bcache we should use to hold macro names, argument names, and
definitions, or zero if we should use xmalloc. */
- struct bcache *bcache;
+ gdb::bcache *bcache;
/* The main source file for this compilation unit --- the one whose
name was given to the compiler. This is the root of the
@@ -1025,7 +1025,7 @@ macro_for_each_in_scope (struct macro_source_file *file, int line,
struct macro_table *
-new_macro_table (struct obstack *obstack, struct bcache *b,
+new_macro_table (struct obstack *obstack, gdb::bcache *b,
struct compunit_symtab *cust)
{
struct macro_table *t;
@@ -23,9 +23,12 @@
#include "gdbsupport/function-view.h"
struct obstack;
-struct bcache;
struct compunit_symtab;
+namespace gdb {
+struct bcache;
+}
+
/* How do we represent a source location? I mean, how should we
represent them within GDB; the user wants to use all sorts of
ambiguous abbreviations, like "break 32" and "break foo.c:32"
@@ -170,7 +173,7 @@ struct macro_source_file
the same source location (although 'gcc -DFOO -UFOO -DFOO=2' does
do that in GCC 4.1.2.). */
struct macro_table *new_macro_table (struct obstack *obstack,
- struct bcache *bcache,
+ gdb::bcache *bcache,
struct compunit_symtab *cust);
@@ -244,11 +244,11 @@ struct objfile_per_bfd_storage
/* Byte cache for file names. */
- struct bcache filename_cache;
+ gdb::bcache filename_cache;
/* Byte cache for macros. */
- struct bcache macro_cache;
+ gdb::bcache macro_cache;
/* The gdbarch associated with the BFD. Note that this gdbarch is
determined solely from BFD information, without looking at target
@@ -1530,14 +1530,15 @@ psymbol_hash (const void *addr, int length)
unsigned int domain = psymbol->domain;
unsigned int theclass = psymbol->aclass;
- h = hash_continue (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
- h = hash_continue (&lang, sizeof (unsigned int), h);
- h = hash_continue (&domain, sizeof (unsigned int), h);
- h = hash_continue (&theclass, sizeof (unsigned int), h);
+ h = gdb::hash_continue (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value),
+ h);
+ h = gdb::hash_continue (&lang, sizeof (unsigned int), h);
+ h = gdb::hash_continue (&domain, sizeof (unsigned int), h);
+ h = gdb::hash_continue (&theclass, sizeof (unsigned int), h);
/* Note that psymbol names are interned via symbol_set_names, so
there's no need to hash the contents of the name here. */
- h = hash_continue (&psymbol->ginfo.name,
- sizeof (psymbol->ginfo.name), h);
+ h = gdb::hash_continue (&psymbol->ginfo.name,
+ sizeof (psymbol->ginfo.name), h);
return h;
}
@@ -120,7 +120,7 @@ public:
/* A byte cache where we can stash arbitrary "chunks" of bytes that
will not change. */
- struct bcache psymbol_cache;
+ gdb::bcache psymbol_cache;
/* Vectors of all partial symbols read in from file. The actual data
is stored in the objfile_obstack. */
@@ -4778,7 +4778,7 @@ find_name_end (const char *name)
int
hashname (const char *name)
{
- return hash (name, strlen (name)) % HASHSIZE;
+ return gdb::hash (name, strlen (name)) % HASHSIZE;
}
/* Initializer for this module. */