LLVM  5.0.0
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:
[legend]

Public Types

typedef std::vector< Type * > TypeList
 
typedef std::vector< std::pair
< const Value *, unsigned > > 
ValueList
 
typedef std::pair< unsigned,
AttributeSet > 
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. More...
 

Public Member Functions

 ValueEnumerator (const Module &M, bool ShouldPreserveUseListOrder)
 
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 ValueList & getValues () 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 TypeList & getTypes () const
 
const std::vector< const
BasicBlock * > & 
getBasicBlocks () const
 
const std::vector
< AttributeList > & 
getAttributeLists () const
 
const std::vector
< IndexAndAttrSet > & 
getAttributeGroups () const
 
const ComdatSetType & getComdats () 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 44 of file ValueEnumerator.h.

Member Typedef Documentation

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 53 of file ValueEnumerator.h.

typedef std::vector<Type*> llvm::ValueEnumerator::TypeList

Definition at line 46 of file ValueEnumerator.h.

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

Definition at line 49 of file ValueEnumerator.h.

Constructor & Destructor Documentation

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

Member Function Documentation

uint64_t ValueEnumerator::computeBitsRequiredForTypeIndicies ( ) const

Definition at line 1012 of file ValueEnumerator.cpp.

References getTypes(), and llvm::Log2_32_Ceil().

LLVM_DUMP_METHOD void ValueEnumerator::dump ( ) const

Definition at line 439 of file ValueEnumerator.cpp.

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

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

Definition at line 215 of file ValueEnumerator.h.

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

Definition at line 214 of file ValueEnumerator.h.

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

Definition at line 211 of file ValueEnumerator.h.

unsigned ValueEnumerator::getComdatID ( const Comdat *  C) const

Definition at line 419 of file ValueEnumerator.cpp.

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

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

Definition at line 219 of file ValueEnumerator.h.

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 190 of file ValueEnumerator.h.

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 1003 of file ValueEnumerator.cpp.

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

unsigned ValueEnumerator::getInstructionID ( const Instruction *  I) const
ArrayRef<const Metadata *> llvm::ValueEnumerator::getMDStrings ( ) const
inline

Get the MDString metadata for this block.

Definition at line 201 of file ValueEnumerator.h.

References llvm::makeArrayRef().

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

Definition at line 152 of file ValueEnumerator.h.

References assert(), and getMetadataOrNullID().

Referenced by getValueID().

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

Get the non-MDString metadata for this block.

Definition at line 206 of file ValueEnumerator.h.

References llvm::makeArrayRef().

unsigned llvm::ValueEnumerator::getTypeID ( Type *  T) const
inline
const TypeList& llvm::ValueEnumerator::getTypes ( ) const
inline

Definition at line 210 of file ValueEnumerator.h.

Referenced by computeBitsRequiredForTypeIndicies().

unsigned ValueEnumerator::getValueID ( const Value *  V) const
const ValueList& llvm::ValueEnumerator::getValues ( ) const
inline

Definition at line 195 of file ValueEnumerator.h.

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

Check whether the current block has any metadata to emit.

Definition at line 198 of file ValueEnumerator.h.

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 918 of file ValueEnumerator.cpp.

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

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

Definition at line 160 of file ValueEnumerator.h.

void ValueEnumerator::print ( raw_ostream &  OS,
const ValueMapType &  Map,
const char *  Name 
) const
void ValueEnumerator::print ( raw_ostream &  OS,
const MetadataMapType &  Map,
const char *  Name 
) const
void ValueEnumerator::purgeFunction ( )
void ValueEnumerator::setInstructionID ( const Instruction *  I)

Definition at line 425 of file ValueEnumerator.cpp.

References I.

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

Definition at line 162 of file ValueEnumerator.h.

Member Data Documentation

UseListOrderStack llvm::ValueEnumerator::UseListOrders

Definition at line 55 of file ValueEnumerator.h.

Referenced by ValueEnumerator().


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