#include "gdbsupport/scoped_restore.h"
#include <chrono>
+#ifdef HAVE_LIBXXHASH
+#include <xxhash.h>
+#endif
+
struct completion_match_for_lcd;
class compiled_regex;
const gdb_byte *source, ULONGEST source_offset,
ULONGEST nbits, int bits_big_endian);
+/* A fast hashing function. This can be used to hash strings in a fast way
+ when the length is known. If no fast hashing library is available, falls
+ back to iterative_hash from libiberty. */
+
+static inline unsigned int
+fast_hash (const char* str, size_t len)
+{
+#ifdef HAVE_LIBXXHASH
+ return XXH64 (str, len, 0);
+#else
+ return iterative_hash (str, len, 0);
+#endif
+}
+
#endif /* UTILS_H */