LLVM 22.0.0git
llvm::IntEqClasses Class Reference

#include "llvm/ADT/IntEqClasses.h"

Public Member Functions

 IntEqClasses (unsigned N=0)
 IntEqClasses - Create an equivalence class mapping for 0 .. N-1.
LLVM_ABI void grow (unsigned N)
 grow - Increase capacity to hold 0 .
void clear ()
 clear - Clear all classes so that grow() will assign a unique class to every integer.
LLVM_ABI unsigned join (unsigned a, unsigned b)
 Join the equivalence classes of a and b.
LLVM_ABI unsigned findLeader (unsigned a) const
 findLeader - Compute the leader of a's equivalence class.
LLVM_ABI void compress ()
 compress - Compress equivalence classes by numbering them 0 .
unsigned getNumClasses () const
 getNumClasses - Return the number of equivalence classes after compress() was called.
unsigned operator[] (unsigned a) const
 operator[] - Return a's equivalence class number, 0 .
LLVM_ABI void uncompress ()
 uncompress - Change back to the uncompressed representation that allows editing.

Detailed Description

Definition at line 29 of file IntEqClasses.h.

Constructor & Destructor Documentation

◆ IntEqClasses()

llvm::IntEqClasses::IntEqClasses ( unsigned N = 0)
inline

IntEqClasses - Create an equivalence class mapping for 0 .. N-1.

Definition at line 43 of file IntEqClasses.h.

References grow(), and N.

Member Function Documentation

◆ clear()

void llvm::IntEqClasses::clear ( )
inline

clear - Clear all classes so that grow() will assign a unique class to every integer.

Definition at line 52 of file IntEqClasses.h.

◆ compress()

void IntEqClasses::compress ( )

compress - Compress equivalence classes by numbering them 0 .

. M. This makes the equivalence class map immutable.

Definition at line 60 of file IntEqClasses.cpp.

◆ findLeader()

unsigned IntEqClasses::findLeader ( unsigned a) const

findLeader - Compute the leader of a's equivalence class.

This is the smallest member of the class. This requires an uncompressed map.

Definition at line 53 of file IntEqClasses.cpp.

References assert().

◆ getNumClasses()

unsigned llvm::IntEqClasses::getNumClasses ( ) const
inline

getNumClasses - Return the number of equivalence classes after compress() was called.

Definition at line 73 of file IntEqClasses.h.

◆ grow()

void IntEqClasses::grow ( unsigned N)

grow - Increase capacity to hold 0 .

. N-1, putting new integers in unique equivalence classes. This requires an uncompressed map.

Definition at line 25 of file IntEqClasses.cpp.

References assert(), and N.

Referenced by IntEqClasses().

◆ join()

unsigned IntEqClasses::join ( unsigned a,
unsigned b )

Join the equivalence classes of a and b.

After joining classes, findLeader(a) == findLeader(b). This requires an uncompressed map. Returns the new leader.

Definition at line 32 of file IntEqClasses.cpp.

References assert().

◆ operator[]()

unsigned llvm::IntEqClasses::operator[] ( unsigned a) const
inline

operator[] - Return a's equivalence class number, 0 .

. getNumClasses()-1. This requires a compressed map.

Definition at line 77 of file IntEqClasses.h.

References assert().

◆ uncompress()

void IntEqClasses::uncompress ( )

uncompress - Change back to the uncompressed representation that allows editing.

Definition at line 67 of file IntEqClasses.cpp.

References llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().


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