struct SparseSetValTraits

Declaration

template <typename ValueT>
struct SparseSetValTraits { /* full declaration omitted */ };

Description

SparseSetValTraits - Objects in a SparseSet are identified by keys that can be uniquely converted to a small integer less than the set's universe. This class allows the set to hold values that differ from the set's key type as long as an index can still be derived from the value. SparseSet never directly compares ValueT, only their indices, so it can map keys to arbitrary values. SparseSetValTraits computes the index from the value object. To compute the index from a key, SparseSet uses a separate KeyFunctorT template argument. A simple type declaration, SparseSet <Type >, handles these cases: - unsigned key, identity index, identity value - unsigned key, identity index, fat value providing getSparseSetIndex() The type declaration SparseSet <Type , UnaryFunction> handles: - unsigned key, remapped index, identity value (virtual registers) - pointer key, pointer-derived index, identity value (node+ID) - pointer key, pointer-derived index, fat value with getSparseSetIndex() Only other, unexpected cases require specializing SparseSetValTraits. For best results, ValueT should not require a destructor.

Declared at: llvm/include/llvm/ADT/SparseSet.h:57

Templates

ValueT

Method Overview

  • public static unsigned int getValIndex(const ValueT & Val)

Methods

ΒΆstatic unsigned int getValIndex(const ValueT& Val)

Declared at: llvm/include/llvm/ADT/SparseSet.h:58

Parameters

const ValueT& Val