LLVM  10.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > Class Template Reference

PointerIntPair - This class implements a pair of a pointer and small integer. More...

#include "llvm/ADT/PointerIntPair.h"

Inheritance diagram for llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >:
Inheritance graph
[legend]

Public Member Functions

constexpr PointerIntPair ()=default
 
 PointerIntPair (PointerTy PtrVal, IntType IntVal)
 
 PointerIntPair (PointerTy PtrVal)
 
PointerTy getPointer () const
 
IntType getInt () const
 
void setPointer (PointerTy PtrVal) LLVM_LVALUE_FUNCTION
 
void setInt (IntType IntVal) LLVM_LVALUE_FUNCTION
 
void initWithPointer (PointerTy PtrVal) LLVM_LVALUE_FUNCTION
 
void setPointerAndInt (PointerTy PtrVal, IntType IntVal) LLVM_LVALUE_FUNCTION
 
PointerTy constgetAddrOfPointer () const
 
PointerTygetAddrOfPointer ()
 
void * getOpaqueValue () const
 
void setFromOpaqueValue (void *Val) LLVM_LVALUE_FUNCTION
 
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
 

Static Public Member Functions

static PointerIntPair getFromOpaqueValue (void *V)
 
static PointerIntPair getFromOpaqueValue (const void *V)
 

Detailed Description

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
class llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >

PointerIntPair - This class implements a pair of a pointer and small integer.

It is designed to represent this in the space required by one pointer by bitmangling the integer into the low part of the pointer. This can only be done for small integers: typically up to 3 bits, but it depends on the number of bits available according to PointerLikeTypeTraits for the type.

Note that PointerIntPair always puts the IntVal part in the highest bits possible. For example, PointerIntPair<void*, 1, bool> will put the bit for the bool into bit #2, not bit #0, which allows the low two bits to be used for something else. For example, this allows: PointerIntPair<PointerIntPair<void*, 1, bool>, 1, bool> ... and the two bools will land in different bits.

Definition at line 45 of file PointerIntPair.h.

Constructor & Destructor Documentation

◆ PointerIntPair() [1/3]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
constexpr llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( )
default

◆ PointerIntPair() [2/3]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( PointerTy  PtrVal,
IntType  IntVal 
)
inline

Definition at line 53 of file PointerIntPair.h.

◆ PointerIntPair() [3/3]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( PointerTy  PtrVal)
inlineexplicit

Definition at line 57 of file PointerIntPair.h.

Member Function Documentation

◆ getAddrOfPointer() [1/2]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy const* llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getAddrOfPointer ( ) const
inline

◆ getAddrOfPointer() [2/2]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy* llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getAddrOfPointer ( )
inline

Definition at line 84 of file PointerIntPair.h.

◆ getFromOpaqueValue() [1/2]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
static PointerIntPair llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getFromOpaqueValue ( void *  V)
inlinestatic

◆ getFromOpaqueValue() [2/2]

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
static PointerIntPair llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getFromOpaqueValue ( const void *  V)
inlinestatic

Definition at line 105 of file PointerIntPair.h.

◆ getInt()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
IntType llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt ( ) const
inline

◆ getOpaqueValue()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void* llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getOpaqueValue ( ) const
inline

◆ getPointer()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer ( ) const
inline

Definition at line 59 of file PointerIntPair.h.

Referenced by llvm::GlobalsAAResult::FunctionInfo::addFunctionInfo(), llvm::ValueHandleBase::clearValPtr(), llvm::SplitEditor::dump(), llvm::X86AsmPrinter::EmitFunctionBodyEnd(), emitNonLazySymbolPointer(), llvm::GlobalsAAResult::FunctionInfo::FunctionInfo(), llvm::IntervalMapImpl::NodeRef::get(), llvm::PointerIntPair< llvm::IntrusiveBackListNode *, 1 >::getAddrOfPointer(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::gvn::AvailableValue::getCoercedLoadValue(), llvm::RegionNodeBase< RegionTraits< Function > >::getEntry(), llvm::MCSymbol::getFragment(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::getInstruction(), getMCSymbolForTOCPseudoMO(), llvm::gvn::AvailableValue::getMemIntrinValue(), llvm::IntrusiveBackListNode::getNext(), llvm::LazyCallGraph::Edge::getNode(), llvm::gvn::AvailableValue::getSimpleValue(), GetSymbolFromOperand(), llvm::cfg::Update< NodePtr >::getTo(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::RecordVal::getType(), llvm::SlotIndex::isValid(), llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::operator bool(), llvm::LazyCallGraph::Edge::operator bool(), llvm::unique_function< ReturnT(ParamTs...)>::operator bool(), llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::operator->(), llvm::GlobalsAAResult::FunctionInfo::operator=(), llvm::IntervalMapImpl::NodeRef::operator==(), llvm::MemoryDependenceResults::removeInstruction(), llvm::SlotIndex::SlotIndex(), llvm::IntervalMapImpl::NodeRef::subtree(), llvm::PtrUseVisitor< SliceBuilder >::visitPtr(), and llvm::unique_function< ReturnT(ParamTs...)>::~unique_function().

◆ initWithPointer()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::initWithPointer ( PointerTy  PtrVal)
inline

◆ operator!=()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator!= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 114 of file PointerIntPair.h.

◆ operator<()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator< ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 118 of file PointerIntPair.h.

◆ operator<=()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator<= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 121 of file PointerIntPair.h.

◆ operator==()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator== ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 110 of file PointerIntPair.h.

◆ operator>()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator> ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 119 of file PointerIntPair.h.

◆ operator>=()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator>= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

Definition at line 125 of file PointerIntPair.h.

◆ setFromOpaqueValue()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setFromOpaqueValue ( void *  Val)
inline

◆ setInt()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setInt ( IntType  IntVal)
inline

◆ setPointer()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setPointer ( PointerTy  PtrVal)
inline

◆ setPointerAndInt()

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setPointerAndInt ( PointerTy  PtrVal,
IntType  IntVal 
)
inline

The documentation for this class was generated from the following file: