[llvm-commits] [llvm] r62535 - in /llvm/trunk: include/llvm/ADT/DenseMap.h lib/Transforms/Scalar/GVN.cpp

Chris Lattner sabre at nondot.org
Mon Jan 19 14:00:18 PST 2009


Author: lattner
Date: Mon Jan 19 16:00:18 2009
New Revision: 62535

URL: http://llvm.org/viewvc/llvm-project?rev=62535&view=rev
Log:
improve compatibility with cygwin, patch by Jay Foad!

Modified:
    llvm/trunk/include/llvm/ADT/DenseMap.h
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=62535&r1=62534&r2=62535&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Jan 19 16:00:18 2009
@@ -44,12 +44,23 @@
 };
 
 // Provide DenseMapInfo for unsigned ints.
-template<> struct DenseMapInfo<uint32_t> {
-  static inline uint32_t getEmptyKey() { return ~0; }
-  static inline uint32_t getTombstoneKey() { return ~0 - 1; }
-  static unsigned getHashValue(const uint32_t& Val) { return Val * 37; }
+template<> struct DenseMapInfo<unsigned> {
+  static inline unsigned getEmptyKey() { return ~0; }
+  static inline unsigned getTombstoneKey() { return ~0 - 1; }
+  static unsigned getHashValue(const unsigned& Val) { return Val * 37; }
   static bool isPod() { return true; }
-  static bool isEqual(const uint32_t& LHS, const uint32_t& RHS) {
+  static bool isEqual(const unsigned& LHS, const unsigned& RHS) {
+  return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for unsigned longs.
+template<> struct DenseMapInfo<unsigned long> {
+  static inline unsigned long getEmptyKey() { return ~0L; }
+  static inline unsigned long getTombstoneKey() { return ~0L - 1L; }
+  static unsigned getHashValue(const unsigned long& Val) { return Val * 37L; }
+  static bool isPod() { return true; }
+  static bool isEqual(const unsigned long& LHS, const unsigned long& RHS) {
   return LHS == RHS;
   }
 };

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=62535&r1=62534&r2=62535&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Jan 19 16:00:18 2009
@@ -1251,7 +1251,7 @@
     DenseMap<BasicBlock*, ValueNumberScope*>::iterator LA =
                                                        localAvail.find(Current);
     if (LA == localAvail.end()) return 0;
-    DenseMap<unsigned, Value*>::iterator V = LA->second->table.find(valno);
+    DenseMap<uint32_t, Value*>::iterator V = LA->second->table.find(valno);
     
     if (V != LA->second->table.end()) {
       // Found an instance, record it.





More information about the llvm-commits mailing list