aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp1
-rw-r--r--lib/CodeGen/RegAllocBigBlock.cpp1
-rw-r--r--lib/Target/TargetData.cpp8
-rw-r--r--lib/Transforms/Scalar/GVN.cpp5
-rw-r--r--lib/Transforms/Scalar/GVNPRE.cpp5
-rw-r--r--lib/Transforms/Utils/PromoteMemoryToRegister.cpp18
-rw-r--r--lib/VMCore/Constants.cpp8
7 files changed, 34 insertions, 12 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index cf6a922d23..10f7c99184 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -2942,6 +2942,7 @@ private:
static inline unsigned getEmptyKey() { return -1U; }
static inline unsigned getTombstoneKey() { return -2U; }
static unsigned getHashValue(const unsigned &Key) { return Key; }
+ static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
static bool isPod() { return true; }
};
diff --git a/lib/CodeGen/RegAllocBigBlock.cpp b/lib/CodeGen/RegAllocBigBlock.cpp
index c7f23f51d4..7f402a62b8 100644
--- a/lib/CodeGen/RegAllocBigBlock.cpp
+++ b/lib/CodeGen/RegAllocBigBlock.cpp
@@ -63,6 +63,7 @@ namespace {
struct VRegKeyInfo {
static inline unsigned getEmptyKey() { return -1U; }
static inline unsigned getTombstoneKey() { return -2U; }
+ static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
static unsigned getHashValue(const unsigned &Key) { return Key; }
};
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 9f7cb00379..5ab4a60ddc 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -316,9 +316,13 @@ struct DenseMapLayoutKeyInfo {
return LayoutKey((TargetData*)(intptr_t)-1, 0);
}
static unsigned getHashValue(const LayoutKey &Val) {
- return DenseMapKeyInfo<void*>::getHashValue(Val.first) ^
- DenseMapKeyInfo<void*>::getHashValue(Val.second);
+ return DenseMapInfo<void*>::getHashValue(Val.first) ^
+ DenseMapInfo<void*>::getHashValue(Val.second);
}
+ static bool isEqual(const LayoutKey &LHS, const LayoutKey &RHS) {
+ return LHS == RHS;
+ }
+
static bool isPod() { return true; }
};
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 7f809e7397..c6b50a4002 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -145,7 +145,7 @@ namespace {
}
namespace llvm {
-template <> struct DenseMapKeyInfo<Expression> {
+template <> struct DenseMapInfo<Expression> {
static inline Expression getEmptyKey() {
return Expression(Expression::EMPTY);
}
@@ -171,6 +171,9 @@ template <> struct DenseMapKeyInfo<Expression> {
return hash;
}
+ static bool isEqual(const Expression &LHS, const Expression &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return true; }
};
}
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp
index d362f54b49..b3d2fe2d5a 100644
--- a/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/lib/Transforms/Scalar/GVNPRE.cpp
@@ -155,7 +155,7 @@ namespace {
}
namespace llvm {
-template <> struct DenseMapKeyInfo<Expression> {
+template <> struct DenseMapInfo<Expression> {
static inline Expression getEmptyKey() {
return Expression(Expression::EMPTY);
}
@@ -181,6 +181,9 @@ template <> struct DenseMapKeyInfo<Expression> {
return hash;
}
+ static bool isEqual(const Expression &LHS, const Expression &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return true; }
};
}
diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 3348971138..c32457d670 100644
--- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -39,18 +39,22 @@ STATISTIC(NumSingleStore, "Number of alloca's promoted with a single store");
STATISTIC(NumDeadAlloca, "Number of dead alloca's removed");
STATISTIC(NumPHIInsert, "Number of PHI nodes inserted");
-// Provide DenseMapKeyInfo for all pointers.
+// Provide DenseMapInfo for all pointers.
namespace llvm {
template<>
-struct DenseMapKeyInfo<std::pair<BasicBlock*, unsigned> > {
- static inline std::pair<BasicBlock*, unsigned> getEmptyKey() {
- return std::make_pair((BasicBlock*)-1, ~0U);
+struct DenseMapInfo<std::pair<BasicBlock*, unsigned> > {
+ typedef std::pair<BasicBlock*, unsigned> EltTy;
+ static inline EltTy getEmptyKey() {
+ return EltTy(reinterpret_cast<BasicBlock*>(-1), ~0U);
}
- static inline std::pair<BasicBlock*, unsigned> getTombstoneKey() {
- return std::make_pair((BasicBlock*)-2, 0U);
+ static inline EltTy getTombstoneKey() {
+ return EltTy(reinterpret_cast<BasicBlock*>(-2), 0U);
}
static unsigned getHashValue(const std::pair<BasicBlock*, unsigned> &Val) {
- return DenseMapKeyInfo<void*>::getHashValue(Val.first) + Val.second*2;
+ return DenseMapInfo<void*>::getHashValue(Val.first) + Val.second*2;
+ }
+ static bool isEqual(const EltTy &LHS, const EltTy &RHS) {
+ return LHS == RHS;
}
static bool isPod() { return true; }
};
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 2bcd7b68b7..28b7e45bf5 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -203,9 +203,12 @@ namespace {
static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), 0); }
static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), 0); }
static unsigned getHashValue(const KeyTy &Key) {
- return DenseMapKeyInfo<void*>::getHashValue(Key.type) ^
+ return DenseMapInfo<void*>::getHashValue(Key.type) ^
Key.val.getHashValue();
}
+ static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return false; }
};
}
@@ -293,6 +296,9 @@ namespace {
static unsigned getHashValue(const KeyTy &Key) {
return Key.val.getHashValue();
}
+ static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) {
+ return LHS == RHS;
+ }
static bool isPod() { return false; }
};
}