[llvm-commits] CVS: llvm/include/llvm/ADT/hash_map.in

Jeff Cohen jeffc at jolt-lang.org
Tue Mar 15 21:49:17 PST 2005



Changes in directory llvm/include/llvm/ADT:

hash_map.in updated: 1.6 -> 1.7
---
Log message:

Don't provide default hash struct instantiation.

---
Diffs of the changes:  (+9 -6)

 hash_map.in |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/ADT/hash_map.in
diff -u llvm/include/llvm/ADT/hash_map.in:1.6 llvm/include/llvm/ADT/hash_map.in:1.7
--- llvm/include/llvm/ADT/hash_map.in:1.6	Tue Mar 15 23:25:09 2005
+++ llvm/include/llvm/ADT/hash_map.in	Tue Mar 15 23:49:06 2005
@@ -106,20 +106,21 @@
 // out specializations like stl_bvector.h, causing link conflicts.
 #include <vector>
 
-#include "llvm/ADT/HashExtras.h"
-
 #ifdef _MSC_VER
 
 // GCC and VC++ have differing ways of implementing hash_maps.  As it's not
 // standardized, that's to be expected.  This adapter class allows VC++
 // hash_map to use GCC's hash classes.
 namespace stdext {
-  template<class Key> struct hash {
-    inline size_t operator()(const Key &) const {
-      return 0;
+  template<class Key> struct hash;
+  
+  // Provide a hash function for unsigned ints...
+  template<> struct hash<unsigned int> {
+    inline size_t operator()(unsigned int Val) const {
+	  return Val;
     }
   };
-  
+
   template<class Key> class hash_compare<Key, std::less<Key> > {
     std::less<Key> comp;
   public:
@@ -134,4 +135,6 @@
 
 #endif
 
+#include "llvm/ADT/HashExtras.h"
+
 #endif






More information about the llvm-commits mailing list