mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-18 10:31:57 +00:00
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
This commit is contained in:
parent
911c8b21da
commit
540db8bcb8
@ -14,7 +14,6 @@
|
|||||||
#ifndef LLVM_ADT_POINTERINTPAIR_H
|
#ifndef LLVM_ADT_POINTERINTPAIR_H
|
||||||
#define LLVM_ADT_POINTERINTPAIR_H
|
#define LLVM_ADT_POINTERINTPAIR_H
|
||||||
|
|
||||||
#include "llvm/Support/DataTypes.h"
|
|
||||||
#include "llvm/Support/PointerLikeTypeTraits.h"
|
#include "llvm/Support/PointerLikeTypeTraits.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@ -37,10 +36,10 @@ struct DenseMapInfo;
|
|||||||
/// PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool>
|
/// PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool>
|
||||||
/// ... and the two bools will land in different bits.
|
/// ... 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 {
|
class PointerIntPair {
|
||||||
intptr_t Value;
|
intptr_t Value;
|
||||||
typedef PointerLikeTypeTraits<PointerTy> PtrTraits;
|
|
||||||
enum {
|
enum {
|
||||||
/// PointerBitMask - The bits that come from the pointer.
|
/// PointerBitMask - The bits that come from the pointer.
|
||||||
PointerBitMask = ~(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),
|
PointerBitMask = ~(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),
|
||||||
|
Loading…
Reference in New Issue
Block a user