LLVM 23.0.0git
llvm::FoldingSetNodeID Class Reference

This class is used to gather all the unique data bits of a node. More...

#include "llvm/ADT/FoldingSet.h"

Public Member Functions

 FoldingSetNodeID ()=default
 FoldingSetNodeID (FoldingSetNodeIDRef Ref)
void AddPointer (const void *Ptr)
 Add* - Add various data types to Bit data.
void AddInteger (signed I)
void AddInteger (unsigned I)
void AddInteger (long I)
void AddInteger (unsigned long I)
void AddInteger (long long I)
void AddInteger (unsigned long long I)
void AddBoolean (bool B)
LLVM_ABI void AddString (StringRef String)
 Add* - Add various data types to Bit data.
LLVM_ABI void AddNodeID (const FoldingSetNodeID &ID)
template<typename T>
void Add (const T &x)
void clear ()
 Clear the accumulated profile, allowing this FoldingSetNodeID object to be used to compute a new profile.
unsigned ComputeHash () const
unsigned computeStableHash () const
LLVM_ABI bool operator== (const FoldingSetNodeID &RHS) const
 operator== - Used to compare two nodes to each other.
LLVM_ABI bool operator== (const FoldingSetNodeIDRef RHS) const
 operator== - Used to compare two nodes to each other.
bool operator!= (const FoldingSetNodeID &RHS) const
bool operator!= (const FoldingSetNodeIDRef RHS) const
LLVM_ABI bool operator< (const FoldingSetNodeID &RHS) const
 Used to compare the "ordering" of two nodes as defined by the profiled bits and their ordering defined by memcmp().
LLVM_ABI bool operator< (const FoldingSetNodeIDRef RHS) const
LLVM_ABI FoldingSetNodeIDRef Intern (BumpPtrAllocator &Allocator) const
 Copy this node's data to a memory region allocated from the given allocator and return a FoldingSetNodeIDRef describing the interned data.

Detailed Description

This class is used to gather all the unique data bits of a node.

When all the bits are gathered this class is used to produce a hash value for the node.

Definition at line 208 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ FoldingSetNodeID() [1/2]

llvm::FoldingSetNodeID::FoldingSetNodeID ( )
default

◆ FoldingSetNodeID() [2/2]

llvm::FoldingSetNodeID::FoldingSetNodeID ( FoldingSetNodeIDRef Ref)
inline

Definition at line 224 of file FoldingSet.h.

References getSize(), and llvm::Ref.

Member Function Documentation

◆ Add()

template<typename T>
void llvm::FoldingSetNodeID::Add ( const T & x)
inline

Definition at line 248 of file FoldingSet.h.

References llvm::DefaultFoldingSetTrait< T >::Profile(), and T.

Referenced by llvm::APFloat::Profile().

◆ AddBoolean()

void llvm::FoldingSetNodeID::AddBoolean ( bool B)
inline

Definition at line 243 of file FoldingSet.h.

References AddInteger(), and B().

◆ AddInteger() [1/6]

void llvm::FoldingSetNodeID::AddInteger ( long I)
inline

Definition at line 239 of file FoldingSet.h.

References I.

◆ AddInteger() [2/6]

void llvm::FoldingSetNodeID::AddInteger ( long long I)
inline

Definition at line 241 of file FoldingSet.h.

References I.

◆ AddInteger() [3/6]

void llvm::FoldingSetNodeID::AddInteger ( signed I)
inline

Definition at line 237 of file FoldingSet.h.

References I.

Referenced by AddBoolean(), and AddPointer().

◆ AddInteger() [4/6]

void llvm::FoldingSetNodeID::AddInteger ( unsigned I)
inline

Definition at line 238 of file FoldingSet.h.

References I.

◆ AddInteger() [5/6]

void llvm::FoldingSetNodeID::AddInteger ( unsigned long I)
inline

Definition at line 240 of file FoldingSet.h.

References I.

◆ AddInteger() [6/6]

void llvm::FoldingSetNodeID::AddInteger ( unsigned long long I)
inline

Definition at line 242 of file FoldingSet.h.

References I.

◆ AddNodeID()

void FoldingSetNodeID::AddNodeID ( const FoldingSetNodeID & ID)

Definition at line 103 of file FoldingSet.cpp.

References FoldingSetNodeID().

◆ AddPointer()

void llvm::FoldingSetNodeID::AddPointer ( const void * Ptr)
inline

Add* - Add various data types to Bit data.

Definition at line 228 of file FoldingSet.h.

References AddInteger().

◆ AddString()

void FoldingSetNodeID::AddString ( StringRef String)

Add* - Add various data types to Bit data.

Definition at line 46 of file FoldingSet.cpp.

References llvm::sampleprof::Base, llvm::divideCeil(), llvm::sys::IsBigEndianHost, llvm::sys::IsLittleEndianHost, Size, and llvm::String.

◆ clear()

void llvm::FoldingSetNodeID::clear ( )
inline

Clear the accumulated profile, allowing this FoldingSetNodeID object to be used to compute a new profile.

Definition at line 252 of file FoldingSet.h.

Referenced by llvm::FoldingSetBase::FindNodeOrInsertPos().

◆ ComputeHash()

unsigned llvm::FoldingSetNodeID::ComputeHash ( ) const
inline

◆ computeStableHash()

unsigned llvm::FoldingSetNodeID::computeStableHash ( ) const
inline

Definition at line 263 of file FoldingSet.h.

References llvm::FoldingSetNodeIDRef::computeStableHash().

◆ Intern()

FoldingSetNodeIDRef FoldingSetNodeID::Intern ( BumpPtrAllocator & Allocator) const

Copy this node's data to a memory region allocated from the given allocator and return a FoldingSetNodeIDRef describing the interned data.

Intern - Copy this node's data to a memory region allocated from the given allocator and return a FoldingSetNodeIDRef describing the interned data.

Definition at line 133 of file FoldingSet.cpp.

References llvm::uninitialized_copy().

◆ operator!=() [1/2]

bool llvm::FoldingSetNodeID::operator!= ( const FoldingSetNodeID & RHS) const
inline

Definition at line 271 of file FoldingSet.h.

References FoldingSetNodeID(), and RHS.

◆ operator!=() [2/2]

bool llvm::FoldingSetNodeID::operator!= ( const FoldingSetNodeIDRef RHS) const
inline

Definition at line 272 of file FoldingSet.h.

References RHS.

◆ operator<() [1/2]

bool FoldingSetNodeID::operator< ( const FoldingSetNodeID & RHS) const

Used to compare the "ordering" of two nodes as defined by the profiled bits and their ordering defined by memcmp().

Definition at line 121 of file FoldingSet.cpp.

References FoldingSetNodeID().

◆ operator<() [2/2]

bool FoldingSetNodeID::operator< ( const FoldingSetNodeIDRef RHS) const

Definition at line 125 of file FoldingSet.cpp.

◆ operator==() [1/2]

bool FoldingSetNodeID::operator== ( const FoldingSetNodeID & RHS) const

operator== - Used to compare two nodes to each other.

Definition at line 109 of file FoldingSet.cpp.

References FoldingSetNodeID().

◆ operator==() [2/2]

bool FoldingSetNodeID::operator== ( const FoldingSetNodeIDRef RHS) const

operator== - Used to compare two nodes to each other.

Definition at line 115 of file FoldingSet.cpp.


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