The gdb/stabsread.h and .c files define 2 things that, while originally
intended only for stabs reading, actually end up being used for coff,
ecoff and maybe more debuginfo formats. That is the function "hashname",
and the macro HASHSIZE. Both are used for small hashtables when reading
some symbols with incomplete information.
With the upcoming removal of stabs code, this code should be moved
somewhere, and the only location that looked mildly reasonable was
gdbsupport/common-utils. No change is expected after this commit.
}
}
-/* See stabsread.h. */
-
-int
-hashname (const char *name)
-{
- return fast_hash (name, strlen (name)) % HASHSIZE;
-}
-
/* Initializer for this module. */
void _initialize_stabsread ();
/* Definitions, prototypes, etc for stabs debugging format support
functions. */
-#define HASHSIZE 127 /* Size of things hashed via
- hashname(). */
-
-/* Compute a small integer hash code for the given name. */
-
-extern int hashname (const char *name);
-
/* Count symbols as they are processed, for error messages. */
extern unsigned int symnum;
#endif
}
+/* Legacy hash for symbol names used for several debuginfo formats. */
+
+#define HASHSIZE 127
+
+static inline int
+hashname (const char *name)
+{
+ return fast_hash (name, strlen (name)) % HASHSIZE;
+}
+
namespace gdb
{