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

#include "Bitcode/Writer/ValueEnumerator.h"

Collaboration diagram for llvm::ValueEnumerator:
Collaboration graph
[legend]

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. More...
 

Public Member Functions

 ValueEnumerator (const Module &M, bool ShouldPreserveUseListOrder)
 
 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
 
bool shouldPreserveUseListOrder () 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. More...
 
const ValueListgetValues () const
 
bool hasMDs () const
 Check whether the current block has any metadata to emit. More...
 
ArrayRef< const Metadata * > getMDStrings () const
 Get the MDString metadata for this block. More...
 
ArrayRef< const Metadata * > getNonMDStrings () const
 Get the non-MDString metadata for this block. More...
 
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. More...
 
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! More...
 
void purgeFunction ()
 
uint64_t computeBitsRequiredForTypeIndicies () const
 

Public Attributes

UseListOrderStack UseListOrders
 

Detailed Description

Definition at line 45 of file ValueEnumerator.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 54 of file ValueEnumerator.h.

◆ TypeList

using llvm::ValueEnumerator::TypeList = std::vector<Type *>

Definition at line 47 of file ValueEnumerator.h.

◆ ValueList

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

Definition at line 50 of file ValueEnumerator.h.

Constructor & Destructor Documentation

◆ ValueEnumerator() [1/2]

ValueEnumerator::ValueEnumerator ( const Module M,
bool  ShouldPreserveUseListOrder 
)

◆ ValueEnumerator() [2/2]

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

Member Function Documentation

◆ computeBitsRequiredForTypeIndicies()

uint64_t ValueEnumerator::computeBitsRequiredForTypeIndicies ( ) const

◆ dump()

LLVM_DUMP_METHOD void ValueEnumerator::dump ( ) const

Definition at line 470 of file ValueEnumerator.cpp.

References llvm::dbgs(), and print().

◆ getAttributeGroupID()

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

◆ getAttributeGroups()

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

Definition at line 222 of file ValueEnumerator.h.

Referenced by getAttrKindEncoding().

◆ getAttributeListID()

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

◆ getAttributeLists()

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

Definition at line 220 of file ValueEnumerator.h.

Referenced by getAttrKindEncoding().

◆ getBasicBlocks()

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

Definition at line 216 of file ValueEnumerator.h.

Referenced by emitSignedInt64().

◆ getComdatID()

unsigned ValueEnumerator::getComdatID ( const Comdat C) const

Definition at line 450 of file ValueEnumerator.cpp.

References assert(), and llvm::UniqueVector< T >::idFor().

Referenced by getComdats(), and getStringEncoding().

◆ getComdats()

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

◆ getFunctionConstantRange()

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

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

Definition at line 194 of file ValueEnumerator.h.

Referenced by emitSignedInt64().

◆ getGlobalBasicBlockID()

unsigned 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.

Definition at line 1030 of file ValueEnumerator.cpp.

References llvm::BasicBlock::getParent(), and IncorporateFunctionInfoGlobalBBIDs().

Referenced by emitSignedInt64(), and getComdats().

◆ getInstructionID()

unsigned ValueEnumerator::getInstructionID ( const Instruction I) const

◆ getMDStrings()

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

Get the MDString metadata for this block.

Definition at line 205 of file ValueEnumerator.h.

References llvm::makeArrayRef().

◆ getMetadataID()

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

Definition at line 154 of file ValueEnumerator.h.

References assert(), and getMetadataOrNullID().

Referenced by getOptimizationFlags(), getValueID(), and rotateSign().

◆ getMetadataOrNullID()

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

◆ getNonMDStrings()

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

Get the non-MDString metadata for this block.

Definition at line 210 of file ValueEnumerator.h.

References llvm::makeArrayRef().

◆ getTypeID()

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

◆ getTypes()

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

◆ getValueID()

unsigned ValueEnumerator::getValueID ( const Value V) const

◆ getValues()

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

Definition at line 199 of file ValueEnumerator.h.

Referenced by emitSignedInt64().

◆ hasMDs()

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

Check whether the current block has any metadata to emit.

Definition at line 202 of file ValueEnumerator.h.

◆ incorporateFunction()

void 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!

Definition at line 945 of file ValueEnumerator.cpp.

References llvm::Function::args(), assert(), llvm::ValueMap< KeyT, ValueT, Config >::count(), I, llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::SmallVectorBase::size().

Referenced by emitSignedInt64(), and getComdats().

◆ numMDs()

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

Definition at line 164 of file ValueEnumerator.h.

◆ operator=()

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

◆ print() [1/2]

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

◆ print() [2/2]

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

◆ purgeFunction()

void ValueEnumerator::purgeFunction ( )

◆ setInstructionID()

void ValueEnumerator::setInstructionID ( const Instruction I)

Definition at line 456 of file ValueEnumerator.cpp.

References I.

Referenced by emitSignedInt64(), and getTypeID().

◆ shouldPreserveUseListOrder()

bool llvm::ValueEnumerator::shouldPreserveUseListOrder ( ) const
inline

Definition at line 166 of file ValueEnumerator.h.

Referenced by emitSignedInt64(), and writeIdentificationBlock().

Member Data Documentation

◆ UseListOrders

UseListOrderStack llvm::ValueEnumerator::UseListOrders

Definition at line 56 of file ValueEnumerator.h.

Referenced by emitSignedInt64(), and ValueEnumerator().


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