class FoldingSetBase

Declaration

class FoldingSetBase { /* full declaration omitted */ };

Description

FoldingSetBase - Implements the folding set functionality. The main structure is an array of buckets. Each bucket is indexed by the hash of the nodes it contains. The bucket itself points to the nodes contained in the bucket via a singly linked list. The last node in the list points back to the bucket to facilitate node removal.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:115

Member Variables

protected void** Buckets
Buckets - Array of bucket chains.
protected unsigned int NumBuckets
NumBuckets - Length of the Buckets array. Always a power of 2.
protected unsigned int NumNodes
NumNodes - Number of nodes in the folding set. Growth occurs when NumNodes is greater than twice the number of buckets.

Method Overview

  • protected llvm::FoldingSetBase::Node * FindNodeOrInsertPos(const llvm::FoldingSetNodeID & ID, void *& InsertPos, const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • protected FoldingSetBase(unsigned int Log2InitSize = 6)
  • protected FoldingSetBase(llvm::FoldingSetBase && Arg)
  • protected llvm::FoldingSetBase::Node * GetOrInsertNode(llvm::FoldingSetBase::Node * N, const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • private void GrowBucketCount(unsigned int NewBucketCount, const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • private void GrowHashTable(const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • protected void InsertNode(llvm::FoldingSetBase::Node * N, void * InsertPos, const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • protected bool RemoveNode(llvm::FoldingSetBase::Node * N)
  • public unsigned int capacity()
  • public void clear()
  • public bool empty() const
  • protected void reserve(unsigned int EltCount, const llvm::FoldingSetBase::FoldingSetInfo & Info)
  • public unsigned int size() const
  • protected ~FoldingSetBase()

Methods

llvm::FoldingSetBase::Node* FindNodeOrInsertPos(
    const llvm::FoldingSetNodeID& ID,
    void*& InsertPos,
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

FindNodeOrInsertPos - Look up the node specified by ID. If it exists, return it. If not, return the insertion token that will make insertion faster.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:218

Parameters

const llvm::FoldingSetNodeID& ID
void*& InsertPos
const llvm::FoldingSetBase::FoldingSetInfo& Info

FoldingSetBase(unsigned int Log2InitSize = 6)

Declared at: llvm/include/llvm/ADT/FoldingSet.h:127

Parameters

unsigned int Log2InitSize = 6

FoldingSetBase(llvm::FoldingSetBase&& Arg)

Declared at: llvm/include/llvm/ADT/FoldingSet.h:128

Parameters

llvm::FoldingSetBase&& Arg

llvm::FoldingSetBase::Node* GetOrInsertNode(
    llvm::FoldingSetBase::Node* N,
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. Otherwise, insert 'N' and return it instead.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:213

Parameters

llvm::FoldingSetBase::Node* N
const llvm::FoldingSetBase::FoldingSetInfo& Info

void GrowBucketCount(
    unsigned int NewBucketCount,
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

GrowBucketCount - resize the hash table and rehash everything. NewBucketCount must be a power of two, and must be greater than the old bucket count.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:195

Parameters

unsigned int NewBucketCount
const llvm::FoldingSetBase::FoldingSetInfo& Info

void GrowHashTable(
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

GrowHashTable - Double the size of the hash table and rehash everything.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:190

Parameters

const llvm::FoldingSetBase::FoldingSetInfo& Info

void InsertNode(
    llvm::FoldingSetBase::Node* N,
    void* InsertPos,
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

InsertNode - Insert the specified node into the folding set, knowing that it is not already in the folding set. InsertPos must be obtained from FindNodeOrInsertPos.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:224

Parameters

llvm::FoldingSetBase::Node* N
void* InsertPos
const llvm::FoldingSetBase::FoldingSetInfo& Info

bool RemoveNode(llvm::FoldingSetBase::Node* N)

Description

RemoveNode - Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:208

Parameters

llvm::FoldingSetBase::Node* N

unsigned int capacity()

Description

capacity - Returns the number of nodes permitted in the folding set before a rebucket operation is performed.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:160

void clear()

Description

clear - Remove all nodes from the folding set.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:150

bool empty() const

Description

empty - Returns true if there are no nodes in the folding set.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:156

void reserve(
    unsigned int EltCount,
    const llvm::FoldingSetBase::FoldingSetInfo&
        Info)

Description

reserve - Increase the number of buckets such that adding the EltCount-th node won't cause a rebucket operation. reserve is permitted to allocate more space than requested by EltCount.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:204

Parameters

unsigned int EltCount
const llvm::FoldingSetBase::FoldingSetInfo& Info

unsigned int size() const

Description

size - Returns the number of nodes in the folding set.

Declared at: llvm/include/llvm/ADT/FoldingSet.h:153

~FoldingSetBase()

Declared at: llvm/include/llvm/ADT/FoldingSet.h:130