X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FPointerIntPair.h;h=ccdcd1a8d1b949c5f1698d4a74b0288f28420e84;hb=1cacae0f297b7330c4cd2b4f0a1f95ab2615bd65;hp=73ba3c7293de09fc5b61fb1576d5f178c299ded3;hpb=2fed70daaf6cf77ec62166041fef11ba7cf68173;p=oota-llvm.git diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 73ba3c7293d..ccdcd1a8d1b 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -91,6 +91,17 @@ public: Value |= IntVal << IntShift; // Set new integer. } + PointerTy const *getAddrOfPointer() const { + return const_cast(this)->getAddrOfPointer(); + } + + PointerTy *getAddrOfPointer() { + assert(Value == reinterpret_cast(getPointer()) && + "Can only return the address if IntBits is cleared and " + "PtrTraits doesn't change the pointer"); + return reinterpret_cast(&Value); + } + void *getOpaqueValue() const { return reinterpret_cast(Value); } void setFromOpaqueValue(void *Val) { Value = reinterpret_cast(Val);} @@ -106,6 +117,12 @@ public: bool operator>=(const PointerIntPair &RHS) const {return Value >= RHS.Value;} }; +template struct isPodLike; +template +struct isPodLike > { + static const bool value = true; +}; + // Provide specialization of DenseMapInfo for PointerIntPair. template struct DenseMapInfo > { @@ -125,7 +142,6 @@ struct DenseMapInfo > { return unsigned(IV) ^ unsigned(IV >> 9); } static bool isEqual(const Ty &LHS, const Ty &RHS) { return LHS == RHS; } - static bool isPod() { return true; } }; // Teach SmallPtrSet that PointerIntPair is "basically a pointer".