From 5de2204fe84a89604a31253a299ab265dee76934 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Nov 2001 00:03:19 +0000 Subject: Create a new #include "Support/..." directory structure to move things from "llvm/Support/..." that are not llvm dependant. Move files and fix #includes llvm-svn: 1400 --- llvm/include/Support/HashExtras.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 llvm/include/Support/HashExtras.h (limited to 'llvm/include/Support/HashExtras.h') diff --git a/llvm/include/Support/HashExtras.h b/llvm/include/Support/HashExtras.h new file mode 100644 index 00000000000..6ea831e78f0 --- /dev/null +++ b/llvm/include/Support/HashExtras.h @@ -0,0 +1,27 @@ +//===-- HashExtras.h - Useful functions for STL hash containers --*- C++ -*--=// +// +// This file contains some templates that are useful if you are working with the +// STL Hashed containers. +// +// No library is required when using these functinons. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_HASHEXTRAS_H +#define LLVM_SUPPORT_HASHEXTRAS_H + +#include +#include + +template <> struct hash { + size_t operator()(string const &str) const { + return hash()(str.c_str()); + } +}; + +// Provide a hash function for arbitrary pointers... +template struct hash { + inline size_t operator()(const T *Val) const { return (size_t)Val; } +}; + +#endif -- cgit v1.2.3