Index: llvm/trunk/include/llvm/IR/Dominators.h =================================================================== --- llvm/trunk/include/llvm/IR/Dominators.h +++ llvm/trunk/include/llvm/IR/Dominators.h @@ -15,6 +15,7 @@ #ifndef LLVM_IR_DOMINATORS_H #define LLVM_IR_DOMINATORS_H +#include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/IR/CFG.h" @@ -54,6 +55,26 @@ bool isSingleEdge() const; }; +template <> struct DenseMapInfo { + static unsigned getHashValue(const BasicBlockEdge *V); + typedef DenseMapInfo BBInfo; + static inline BasicBlockEdge getEmptyKey() { + return BasicBlockEdge(BBInfo::getEmptyKey(), BBInfo::getEmptyKey()); + } + static inline BasicBlockEdge getTombstoneKey() { + return BasicBlockEdge(BBInfo::getTombstoneKey(), BBInfo::getTombstoneKey()); + } + + static unsigned getHashValue(const BasicBlockEdge &Edge) { + return hash_combine(BBInfo::getHashValue(Edge.getStart()), + BBInfo::getHashValue(Edge.getEnd())); + } + static bool isEqual(const BasicBlockEdge &LHS, const BasicBlockEdge &RHS) { + return BBInfo::isEqual(LHS.getStart(), RHS.getStart()) && + BBInfo::isEqual(LHS.getEnd(), RHS.getEnd()); + } +}; + /// \brief Concrete subclass of DominatorTreeBase that is used to compute a /// normal dominator tree. ///