Author: evancheng
Date: Tue Jul 10 01:59:55 2007
New Revision: 38484

URL: http://llvm.org/viewvc/llvm-project?rev=38484&view=rev
Log:
Move DenseMapKeyInfo<SDOperand> from LegalizeDAG.cpp to SelectionDAGNodes.h

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=38484&r1=38483&r2=38484&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jul 10 01:59:55 2007
@@ -34,6 +34,7 @@
 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 @@
 };
 
 
+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> {

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=38484&r1=38483&r2=38484&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jul 10 01:59:55 2007
@@ -39,18 +39,6 @@
 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


_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to