diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-29 06:02:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-29 06:02:20 +0000 |
commit | 540db8bcb8d7dae55456d8564c1d54071ec6ed50 (patch) | |
tree | 459da8eb010ed2cc947f95cf552ff4c7070d1096 | |
parent | 911c8b21dac9678e458798b150cebff196a6fc7a (diff) | |
download | external_llvm-540db8bcb8d7dae55456d8564c1d54071ec6ed50.zip external_llvm-540db8bcb8d7dae55456d8564c1d54071ec6ed50.tar.gz external_llvm-540db8bcb8d7dae55456d8564c1d54071ec6ed50.tar.bz2 |
Allow a specific PointerIntPair instance to use a specific Pointer trait:
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
-rw-r--r-- | include/llvm/ADT/PointerIntPair.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 999b802..f189a32 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -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), |