LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
llvm::dxil::ValueEnumerator Class Reference

#include "Target/DirectX/DXILWriter/DXILValueEnumerator.h"

Public Types

using TypeList = std::vector< Type * >
 
using ValueList = std::vector< std::pair< const Value *, unsigned > >
 
using IndexAndAttrSet = std::pair< unsigned, AttributeSet >
 Attribute groups as encoded in bitcode are almost AttributeSets, but they include the AttributeList index, so we have to track that in our map.
 

Public Member Functions

 ValueEnumerator (const Module &M, Type *PrefixType)
 
 ValueEnumerator (const ValueEnumerator &)=delete
 
ValueEnumeratoroperator= (const ValueEnumerator &)=delete
 
void dump () const
 
void print (raw_ostream &OS, const ValueMapType &Map, const char *Name) const
 
void print (raw_ostream &OS, const MetadataMapType &Map, const char *Name) const
 
unsigned getValueID (const Value *V) const
 
unsigned getMetadataID (const Metadata *MD) const
 
unsigned getMetadataOrNullID (const Metadata *MD) const
 
unsigned numMDs () const
 
unsigned getTypeID (Type *T) const
 
unsigned getInstructionID (const Instruction *I) const
 
void setInstructionID (const Instruction *I)
 
unsigned getAttributeListID (AttributeList PAL) const
 
unsigned getAttributeGroupID (IndexAndAttrSet Group) const
 
void getFunctionConstantRange (unsigned &Start, unsigned &End) const
 getFunctionConstantRange - Return the range of values that corresponds to function-local constants.
 
const ValueListgetValues () const
 
bool hasMDs () const
 Check whether the current block has any metadata to emit.
 
ArrayRef< const Metadata * > getMDStrings () const
 Get the MDString metadata for this block.
 
ArrayRef< const Metadata * > getNonMDStrings () const
 Get the non-MDString metadata for this block.
 
const TypeListgetTypes () const
 
const std::vector< const BasicBlock * > & getBasicBlocks () const
 
const std::vector< AttributeList > & getAttributeLists () const
 
const std::vector< IndexAndAttrSet > & getAttributeGroups () const
 
const ComdatSetTypegetComdats () const
 
unsigned getComdatID (const Comdat *C) const
 
unsigned getGlobalBasicBlockID (const BasicBlock *BB) const
 getGlobalBasicBlockID - This returns the function-specific ID for the specified basic block.
 
void incorporateFunction (const Function &F)
 incorporateFunction/purgeFunction - If you'd like to deal with a function, use these two methods to get its data into the ValueEnumerator!
 
void purgeFunction ()
 
uint64_t computeBitsRequiredForTypeIndices () const
 
void EnumerateType (Type *T)
 

Public Attributes

UseListOrderStack UseListOrders
 

Detailed Description

Definition at line 46 of file DXILValueEnumerator.h.

Member Typedef Documentation

◆ IndexAndAttrSet

Attribute groups as encoded in bitcode are almost AttributeSets, but they include the AttributeList index, so we have to track that in our map.

Definition at line 55 of file DXILValueEnumerator.h.

◆ TypeList

Definition at line 48 of file DXILValueEnumerator.h.

◆ ValueList

using llvm::dxil::ValueEnumerator::ValueList = std::vector<std::pair<const Value *, unsigned> >

Definition at line 51 of file DXILValueEnumerator.h.

Constructor & Destructor Documentation

◆ ValueEnumerator() [1/2]

ValueEnumerator::ValueEnumerator ( const Module M,
Type PrefixType 
)

◆ ValueEnumerator() [2/2]

llvm::dxil::ValueEnumerator::ValueEnumerator ( const ValueEnumerator )
delete

Member Function Documentation

◆ computeBitsRequiredForTypeIndices()

uint64_t llvm::dxil::ValueEnumerator::computeBitsRequiredForTypeIndices ( ) const

◆ dump()

void llvm::dxil::ValueEnumerator::dump ( ) const

◆ EnumerateType()

void llvm::dxil::ValueEnumerator::EnumerateType ( Type T)

◆ getAttributeGroupID()

unsigned llvm::dxil::ValueEnumerator::getAttributeGroupID ( IndexAndAttrSet  Group) const
inline

Definition at line 182 of file DXILValueEnumerator.h.

References assert(), and I.

◆ getAttributeGroups()

const std::vector< IndexAndAttrSet > & llvm::dxil::ValueEnumerator::getAttributeGroups ( ) const
inline

Definition at line 222 of file DXILValueEnumerator.h.

◆ getAttributeListID()

unsigned llvm::dxil::ValueEnumerator::getAttributeListID ( AttributeList  PAL) const
inline

Definition at line 174 of file DXILValueEnumerator.h.

References assert(), I, and llvm::AttributeList::isEmpty().

◆ getAttributeLists()

const std::vector< AttributeList > & llvm::dxil::ValueEnumerator::getAttributeLists ( ) const
inline

Definition at line 218 of file DXILValueEnumerator.h.

◆ getBasicBlocks()

const std::vector< const BasicBlock * > & llvm::dxil::ValueEnumerator::getBasicBlocks ( ) const
inline

Definition at line 214 of file DXILValueEnumerator.h.

◆ getComdatID()

unsigned llvm::dxil::ValueEnumerator::getComdatID ( const Comdat C) const

◆ getComdats()

const ComdatSetType & llvm::dxil::ValueEnumerator::getComdats ( ) const
inline

Definition at line 226 of file DXILValueEnumerator.h.

◆ getFunctionConstantRange()

void llvm::dxil::ValueEnumerator::getFunctionConstantRange ( unsigned Start,
unsigned End 
) const
inline

getFunctionConstantRange - Return the range of values that corresponds to function-local constants.

Definition at line 192 of file DXILValueEnumerator.h.

References End.

◆ getGlobalBasicBlockID()

unsigned llvm::dxil::ValueEnumerator::getGlobalBasicBlockID ( const BasicBlock BB) const

getGlobalBasicBlockID - This returns the function-specific ID for the specified basic block.

This is relatively expensive information, so it should only be used by rare constructs such as address-of-label.

◆ getInstructionID()

unsigned llvm::dxil::ValueEnumerator::getInstructionID ( const Instruction I) const

◆ getMDStrings()

ArrayRef< const Metadata * > llvm::dxil::ValueEnumerator::getMDStrings ( ) const
inline

Get the MDString metadata for this block.

Definition at line 203 of file DXILValueEnumerator.h.

References llvm::ArrayRef< T >::slice().

◆ getMetadataID()

unsigned llvm::dxil::ValueEnumerator::getMetadataID ( const Metadata MD) const
inline

Definition at line 153 of file DXILValueEnumerator.h.

References assert(), and getMetadataOrNullID().

◆ getMetadataOrNullID()

unsigned llvm::dxil::ValueEnumerator::getMetadataOrNullID ( const Metadata MD) const
inline

Definition at line 159 of file DXILValueEnumerator.h.

Referenced by getMetadataID().

◆ getNonMDStrings()

ArrayRef< const Metadata * > llvm::dxil::ValueEnumerator::getNonMDStrings ( ) const
inline

Get the non-MDString metadata for this block.

Definition at line 208 of file DXILValueEnumerator.h.

References llvm::ArrayRef< T >::slice().

◆ getTypeID()

unsigned llvm::dxil::ValueEnumerator::getTypeID ( Type T) const
inline

◆ getTypes()

const TypeList & llvm::dxil::ValueEnumerator::getTypes ( ) const
inline

Definition at line 212 of file DXILValueEnumerator.h.

◆ getValueID()

unsigned llvm::dxil::ValueEnumerator::getValueID ( const Value V) const

◆ getValues()

const ValueList & llvm::dxil::ValueEnumerator::getValues ( ) const
inline

◆ hasMDs()

bool llvm::dxil::ValueEnumerator::hasMDs ( ) const
inline

Check whether the current block has any metadata to emit.

Definition at line 200 of file DXILValueEnumerator.h.

◆ incorporateFunction()

void llvm::dxil::ValueEnumerator::incorporateFunction ( const Function F)

incorporateFunction/purgeFunction - If you'd like to deal with a function, use these two methods to get its data into the ValueEnumerator!

◆ numMDs()

unsigned llvm::dxil::ValueEnumerator::numMDs ( ) const
inline

Definition at line 163 of file DXILValueEnumerator.h.

◆ operator=()

ValueEnumerator & llvm::dxil::ValueEnumerator::operator= ( const ValueEnumerator )
delete

◆ print() [1/2]

void llvm::dxil::ValueEnumerator::print ( raw_ostream OS,
const MetadataMapType Map,
const char Name 
) const

◆ print() [2/2]

void llvm::dxil::ValueEnumerator::print ( raw_ostream OS,
const ValueMapType Map,
const char Name 
) const

◆ purgeFunction()

void llvm::dxil::ValueEnumerator::purgeFunction ( )

◆ setInstructionID()

void llvm::dxil::ValueEnumerator::setInstructionID ( const Instruction I)

Member Data Documentation

◆ UseListOrders

UseListOrderStack llvm::dxil::ValueEnumerator::UseListOrders

Definition at line 57 of file DXILValueEnumerator.h.


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