[llvm-commits] [llvm] r67986 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h
Chris Lattner
sabre at nondot.org
Sat Mar 28 23:02:20 PDT 2009
Author: lattner
Date: Sun Mar 29 01:02:20 2009
New Revision: 67986
URL: http://llvm.org/viewvc/llvm-project?rev=67986&view=rev
Log:
Allow a specific PointerIntPair instance to use a specific Pointer trait:
some pointer instances have properties that not all of a type have.
Modified:
llvm/trunk/include/llvm/ADT/PointerIntPair.h
Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=67986&r1=67985&r2=67986&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Mar 29 01:02:20 2009
@@ -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 @@
/// 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),
More information about the llvm-commits
mailing list