Allow a specific PointerIntPair instance to use a specific Pointer trait:
authorChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 06:02:20 +0000 (06:02 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Mar 2009 06:02:20 +0000 (06:02 +0000)
some pointer instances have properties that not all of a type have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67986 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerIntPair.h

index 999b802ffca1160dfc194f9ca69116aa7b8a3d1c..f189a3285820f1f736cb5468a8d4558f77596a95 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef LLVM_ADT_POINTERINTPAIR_H
 #define LLVM_ADT_POINTERINTPAIR_H
 
-#include "llvm/Support/DataTypes.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <cassert>
 
@@ -37,10 +36,10 @@ struct DenseMapInfo;
 ///   PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool>
 /// ... and the two bools will land in different bits.
 ///
-template <typename PointerTy, unsigned IntBits, typename IntType=unsigned>
+template <typename PointerTy, unsigned IntBits, typename IntType=unsigned,
+          typename PtrTraits = PointerLikeTypeTraits<PointerTy> >
 class PointerIntPair {
   intptr_t Value;
-  typedef PointerLikeTypeTraits<PointerTy> PtrTraits;
   enum {
     /// PointerBitMask - The bits that come from the pointer.
     PointerBitMask = ~(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),