14 #ifndef LLVM_ADT_IMMUTABLELIST_H
15 #define LLVM_ADT_IMMUTABLELIST_H
19 #include "llvm/Support/DataTypes.h"
32 : Head(head), Tail(tail) {}
124 assert (!
isEmpty() &&
"Cannot get the head of an empty list.");
131 return X ? X->getTail() : 0;
139 template <
typename T>
140 class ImmutableListFactory {
141 typedef ImmutableListImpl<T> ListTy;
142 typedef FoldingSet<ListTy> CacheTy;
147 bool ownsAllocator()
const {
148 return Allocator & 0x1 ?
false :
true;
151 BumpPtrAllocator& getAllocator()
const {
152 return *
reinterpret_cast<BumpPtrAllocator*
>(Allocator & ~0x1);
160 : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
163 if (ownsAllocator())
delete &getAllocator();
179 new (L)
ListTy(Head, TailImpl);
205 template<
typename T>
struct DenseMapInfo;
215 return (
unsigned((uintptr_t)PtrVal) >> 4) ^
216 (
unsigned((uintptr_t)PtrVal) >> 9);
223 template <
typename T>
struct isPodLike;
224 template <
typename T>
void AddPointer(const void *Ptr)
void Profile(FoldingSetNodeID &ID)
ImmutableListFactory< T > Factory
static ImmutableList< T > getEmptyKey()
ImmutableList getList() const
ImmutableList< T > concat(const T &Head, ImmutableList< T > Tail)
const ImmutableListImpl< T > * getInternalPointer() const
void InsertNode(Node *N, void *InsertPos)
static bool isEqual(ImmutableList< T > X1, ImmutableList< T > X2)
bool operator==(const iterator &I) const
ImmutableList< T > add(const T &D, ImmutableList< T > L)
ID
LLVM Calling Convention Representation.
static ImmutableList< T > getTombstoneKey()
bool operator==(const ImmutableList &L) const
const T & getHead() const
static void Profile(FoldingSetNodeID &ID, const T &H, const ImmutableListImpl *L)
ImmutableList(const ImmutableListImpl< T > *x=0)
ImmutableList< T > getEmptyList() const
const ImmutableListImpl * getTail() const
T * FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos)
ImmutableListFactory(BumpPtrAllocator &Alloc)
const value_type & operator*() const
bool isEmpty() const
isEmpty - Returns true if the list is empty.
ImmutableList< T > create(const T &X)
void Profile(FoldingSetNodeID &ID) const
#define LLVM_DELETED_FUNCTION
void * Allocate(size_t Size, size_t Alignment)
bool contains(const T &V) const
iterator(ImmutableList l)
static unsigned getHashValue(ImmutableList< T > X)
bool isEqual(const ImmutableList &L) const
bool operator!=(const iterator &I) const
const T & getHead()
getHead - Returns the head of the list.
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")