diff options
| -rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 11 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 | 
2 files changed, 11 insertions, 12 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h index c370b50b3e5..316b02af39e 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -34,6 +34,7 @@ class GlobalValue;  class MachineBasicBlock;  class MachineConstantPoolValue;  class SDNode; +template <typename T> struct DenseMapKeyInfo;  template <typename T> struct simplify_type;  template <typename T> struct ilist_traits;  template<typename NodeTy, typename Traits> class iplist; @@ -728,6 +729,16 @@ public:  }; +template<> struct DenseMapKeyInfo<SDOperand> { +  static inline SDOperand getEmptyKey() { return SDOperand((SDNode*)-1, -1U); } +  static inline SDOperand getTombstoneKey() { return SDOperand((SDNode*)-1, 0);} +  static unsigned getHashValue(const SDOperand &Val) { +    return (unsigned)((uintptr_t)Val.Val >> 4) ^ +           (unsigned)((uintptr_t)Val.Val >> 9) + Val.ResNo; +  } +  static bool isPod() { return true; } +}; +  /// simplify_type specializations - Allow casting operators to work directly on  /// SDOperands as if they were SDNode*'s.  template<> struct simplify_type<SDOperand> { diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 27340f19923..63f58c20968 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -39,18 +39,6 @@ ViewLegalizeDAGs("view-legalize-dags", cl::Hidden,  static const bool ViewLegalizeDAGs = 0;  #endif -namespace llvm { -template<> -struct DenseMapKeyInfo<SDOperand> { -  static inline SDOperand getEmptyKey() { return SDOperand((SDNode*)-1, -1U); } -  static inline SDOperand getTombstoneKey() { return SDOperand((SDNode*)-1, 0);} -  static unsigned getHashValue(const SDOperand &Val) { -    return DenseMapKeyInfo<void*>::getHashValue(Val.Val) + Val.ResNo; -  } -  static bool isPod() { return true; } -}; -} -  //===----------------------------------------------------------------------===//  /// SelectionDAGLegalize - This takes an arbitrary SelectionDAG as input and  /// hacks on it until the target machine can handle it.  This involves  | 

