14 #ifndef LLVM_LIB_BITCODE_WRITER_VALUEENUMERATOR_H
15 #define LLVM_LIB_BITCODE_WRITER_VALUEENUMERATOR_H
34 class LocalAsMetadata;
38 class ValueSymbolTable;
47 typedef std::vector<std::pair<const Value*, unsigned> >
ValueList;
63 std::vector<const Metadata *> MDs;
69 bool HasGenericDINode;
70 bool ShouldPreserveUseListOrder;
74 std::vector<AttributeSet> AttributeGroups;
86 unsigned InstructionCount;
90 std::vector<const BasicBlock*> BasicBlocks;
94 unsigned NumModuleValues;
98 unsigned NumModuleMDs;
100 unsigned FirstFuncConstantID;
101 unsigned FirstInstID;
111 const char *
Name)
const;
116 assert(
ID != 0 &&
"Metadata not in slotcalculator!");
120 return MDValueMap.
lookup(MD);
131 assert(I != TypeMap.
end() &&
"Type not in ValueEnumerator!");
141 assert(I != AttributeMap.
end() &&
"Attribute not in ValueEnumerator!");
148 assert(I != AttributeGroupMap.
end() &&
"Attribute not in ValueEnumerator!");
155 Start = FirstFuncConstantID;
160 const std::vector<const Metadata *> &
getMDs()
const {
return MDs; }
162 return FunctionLocalMDs;
172 return AttributeGroups;
191 void OptimizeConstants(
unsigned CstStart,
unsigned CstEnd);
193 void EnumerateMDNodeOperands(
const MDNode *
N);
194 void EnumerateMetadata(
const Metadata *MD);
197 void EnumerateValue(
const Value *V);
198 void EnumerateType(
Type *
T);
199 void EnumerateOperandType(
const Value *V);
203 void EnumerateNamedMetadata(
const Module &M);
This class provides a symbol table of name/value pairs.
const ComdatSetType & getComdats() const
ValueT lookup(const KeyT &Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
A Module instance is used to store all the information related to an LLVM module. ...
void setInstructionID(const Instruction *I)
std::vector< std::pair< const Value *, unsigned > > ValueList
void incorporateFunction(const Function &F)
incorporateFunction/purgeFunction - If you'd like to deal with a function, use these two methods to g...
unsigned getComdatID(const Comdat *C) const
bool hasGenericDINode() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
std::vector< UseListOrder > UseListOrderStack
This file contains the simple types necessary to represent the attributes associated with functions a...
uint64_t computeBitsRequiredForTypeIndicies() const
unsigned getAttributeID(AttributeSet PAL) const
bool hasDILocation() const
const TypeList & getTypes() const
unsigned getInstructionID(const Instruction *I) const
unsigned getValueID(const Value *V) const
void getFunctionConstantRange(unsigned &Start, unsigned &End) const
getFunctionConstantRange - Return the range of values that corresponds to function-local constants...
const ValueList & getValues() const
bool shouldPreserveUseListOrder() const
const std::vector< AttributeSet > & getAttributes() const
unsigned getTypeID(Type *T) const
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned getAttributeGroupID(AttributeSet PAL) const
const std::vector< const Metadata * > & getMDs() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
const SmallVectorImpl< const LocalAsMetadata * > & getFunctionLocalMDs() const
const std::vector< AttributeSet > & getAttributeGroups() const
const std::vector< const BasicBlock * > & getBasicBlocks() const
unsigned getMetadataID(const Metadata *MD) const
UseListOrderStack UseListOrders
unsigned getMetadataOrNullID(const Metadata *MD) const
void print(raw_ostream &OS, const ValueMapType &Map, const char *Name) const
iterator find(const KeyT &Val)
unsigned getGlobalBasicBlockID(const BasicBlock *BB) const
getGlobalBasicBlockID - This returns the function-specific ID for the specified basic block...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
std::vector< Type * > TypeList
bool isEmpty() const
Return true if there are no attributes.