mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
improve compatibility with cygwin, patch by Jay Foad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,12 +44,23 @@ struct DenseMapInfo<T*> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Provide DenseMapInfo for unsigned ints.
|
// Provide DenseMapInfo for unsigned ints.
|
||||||
template<> struct DenseMapInfo<uint32_t> {
|
template<> struct DenseMapInfo<unsigned> {
|
||||||
static inline uint32_t getEmptyKey() { return ~0; }
|
static inline unsigned getEmptyKey() { return ~0; }
|
||||||
static inline uint32_t getTombstoneKey() { return ~0 - 1; }
|
static inline unsigned getTombstoneKey() { return ~0 - 1; }
|
||||||
static unsigned getHashValue(const uint32_t& Val) { return Val * 37; }
|
static unsigned getHashValue(const unsigned& Val) { return Val * 37; }
|
||||||
static bool isPod() { return true; }
|
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;
|
return LHS == RHS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1251,7 +1251,7 @@ Value* GVN::AttemptRedundancyElimination(Instruction* orig, unsigned valno) {
|
|||||||
DenseMap<BasicBlock*, ValueNumberScope*>::iterator LA =
|
DenseMap<BasicBlock*, ValueNumberScope*>::iterator LA =
|
||||||
localAvail.find(Current);
|
localAvail.find(Current);
|
||||||
if (LA == localAvail.end()) return 0;
|
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()) {
|
if (V != LA->second->table.end()) {
|
||||||
// Found an instance, record it.
|
// Found an instance, record it.
|
||||||
|
Reference in New Issue
Block a user