#ifndef LLVM_ADT_POINTERINTPAIR_H
#define LLVM_ADT_POINTERINTPAIR_H
#include "llvm/Support/Compiler.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include "llvm/Support/type_traits.h"
#include <cassert>
#include <cstdint>
#include <cstring>
#include <limits>
namespace llvm {
namespace detail {
template <typename Ptr> struct PunnedPointer { … };
}
template <typename T, typename Enable> struct DenseMapInfo;
template <typename PointerT, unsigned IntBits, typename PtrTraits>
struct PointerIntPairInfo;
template <typename PointerTy, unsigned IntBits, typename IntType = unsigned,
typename PtrTraits = PointerLikeTypeTraits<PointerTy>,
typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
class PointerIntPair {
using InfoTy = Info;
detail::PunnedPointer<PointerTy> Value;
public:
constexpr PointerIntPair() = default;
PointerIntPair(PointerTy PtrVal, IntType IntVal) { … }
explicit PointerIntPair(PointerTy PtrVal) { … }
PointerTy getPointer() const { … }
IntType getInt() const { … }
void setPointer(PointerTy PtrVal) & { … }
void setInt(IntType IntVal) & { … }
void initWithPointer(PointerTy PtrVal) & { … }
void setPointerAndInt(PointerTy PtrVal, IntType IntVal) & { … }
PointerTy const *getAddrOfPointer() const { … }
PointerTy *getAddrOfPointer() { … }
void *getOpaqueValue() const { … }
void setFromOpaqueValue(void *Val) & { … }
static PointerIntPair getFromOpaqueValue(void *V) { … }
static PointerIntPair getFromOpaqueValue(const void *V) { … }
bool operator==(const PointerIntPair &RHS) const { … }
bool operator!=(const PointerIntPair &RHS) const { … }
bool operator<(const PointerIntPair &RHS) const { … }
bool operator>(const PointerIntPair &RHS) const { … }
bool operator<=(const PointerIntPair &RHS) const { … }
bool operator>=(const PointerIntPair &RHS) const { … }
};
template <typename PointerT, unsigned IntBits, typename PtrTraits>
struct PointerIntPairInfo { … };
DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>, void>;
PointerLikeTypeTraits<PointerIntPair<PointerTy, IntBits, IntType, PtrTraits>>;
template <std::size_t I, typename PointerTy, unsigned IntBits, typename IntType,
typename PtrTraits, typename Info>
decltype(auto)
get(const PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info> &Pair) { … }
}
namespace std {
tuple_size<llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>>;
tuple_element<I, llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>>;
}
#endif