diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-19 22:00:18 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-19 22:00:18 +0000 | 
| commit | 73d7fe5a3424bf87cb676c257ce67e845d41e2ed (patch) | |
| tree | abe54997c0c4abf206aa3ec156203a2458382cfc /llvm | |
| parent | dd8ef1bf30637000efd4856d278d6a323374fba1 (diff) | |
| download | bcm5719-llvm-73d7fe5a3424bf87cb676c257ce67e845d41e2ed.tar.gz bcm5719-llvm-73d7fe5a3424bf87cb676c257ce67e845d41e2ed.zip  | |
improve compatibility with cygwin, patch by Jay Foad!
llvm-svn: 62535
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ADT/DenseMap.h | 21 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 2 | 
2 files changed, 17 insertions, 6 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index d1457af4506..df497d37d76 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -44,12 +44,23 @@ struct DenseMapInfo<T*> {  };  // 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;    }  }; diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index e5eef8f99e8..9c7f9041068 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1251,7 +1251,7 @@ Value* GVN::AttemptRedundancyElimination(Instruction* orig, unsigned valno) {      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.  | 

