LLVM API Documentation

llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey > Class Template Reference

Inheritance diagram for llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >:

Inheritance graph
[legend]
Collaboration diagram for llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::pair< const Type *,
ValType > 
MapKey
typedef std::map< MapKey,
Constant * > 
MapTy
typedef std::map< Constant *,
typename MapTy::iterator > 
InverseMapTy
typedef std::map< const Type *,
typename MapTy::iterator > 
AbstractTypeMapTy

Public Member Functions

MapTy::iterator map_end ()
MapTy::iterator InsertOrGetItem (std::pair< MapKey, Constant * > &InsertVal, bool &Exists)
ConstantClass * getOrCreate (const TypeClass *Ty, const ValType &V)
void remove (ConstantClass *CP)
void MoveConstantToNewSlot (ConstantClass *C, typename MapTy::iterator I)
void refineAbstractType (const DerivedType *OldTy, const Type *NewTy)
void typeBecameConcrete (const DerivedType *AbsTy)
void dump () const

Friends

void Constant::clearAllValueMaps ()

Detailed Description

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
class llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >

Definition at line 661 of file Constants.cpp.


Member Typedef Documentation

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
typedef std::pair<const Type*, ValType> llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::MapKey

Definition at line 663 of file Constants.cpp.

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
typedef std::map<MapKey, Constant *> llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::MapTy

Definition at line 664 of file Constants.cpp.

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
typedef std::map<Constant*, typename MapTy::iterator> llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::InverseMapTy

Definition at line 665 of file Constants.cpp.

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
typedef std::map<const Type*, typename MapTy::iterator> llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::AbstractTypeMapTy

Definition at line 666 of file Constants.cpp.


Member Function Documentation

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
MapTy::iterator llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::map_end (  )  [inline]

Definition at line 694 of file Constants.cpp.

References Map.

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
MapTy::iterator llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::InsertOrGetItem ( std::pair< MapKey, Constant * > &  InsertVal,
bool &  Exists 
) [inline]

InsertOrGetItem - Return an iterator for the specified element. If the element exists in the map, the returned iterator points to the entry and Exists=true. If not, the iterator points to the newly inserted entry and returns Exists=false. Newly inserted entries have I->second == 0, and should be filled in.

Definition at line 701 of file Constants.cpp.

References Map.

Referenced by llvm::ConstantStruct::replaceUsesOfWithOnConstant(), and llvm::ConstantArray::replaceUsesOfWithOnConstant().

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
ConstantClass* llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::getOrCreate ( const TypeClass *  Ty,
const ValType &  V 
) [inline]

getOrCreate - Return the specified constant from the map, creating it if necessary.

FIXME: why does this assert fail when loading 176.gcc?

Definition at line 733 of file Constants.cpp.

References Lookup(), and Map.

Referenced by llvm::ConstantStruct::get(), and llvm::ConstantArray::get().

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::remove ( ConstantClass *  CP  )  [inline]

Definition at line 766 of file Constants.cpp.

References Map, and Ty.

Referenced by llvm::ConstantStruct::destroyConstant(), and llvm::ConstantArray::destroyConstant().

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::MoveConstantToNewSlot ( ConstantClass *  C,
typename MapTy::iterator  I 
) [inline]

MoveConstantToNewSlot - If we are about to change C to be the element specified by I, update our internal data structures to reflect this fact.

Definition at line 820 of file Constants.cpp.

References Map.

Referenced by llvm::ConstantStruct::replaceUsesOfWithOnConstant(), and llvm::ConstantArray::replaceUsesOfWithOnConstant().

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::refineAbstractType ( const DerivedType OldTy,
const Type NewTy 
) [inline, virtual]

refineAbstractType - The callback method invoked when an abstract type is resolved to another type. An object must override this method to update its internal state to reference NewType instead of OldType.

Implements llvm::AbstractTypeUser.

Definition at line 848 of file Constants.cpp.

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::typeBecameConcrete ( const DerivedType AbsTy  )  [inline, virtual]

The other case which AbstractTypeUsers must be aware of is when a type makes the transition from being abstract (where it has clients on it's AbstractTypeUsers list) to concrete (where it does not). This method notifies ATU's when this occurs for a type.

Implements llvm::AbstractTypeUser.

Definition at line 870 of file Constants.cpp.

References llvm::Type::removeAbstractTypeUser().

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void llvm::ValueMap< ValType, TypeClass, ConstantClass, HasLargeKey >::dump (  )  const [inline, virtual]

Implements llvm::AbstractTypeUser.

Definition at line 874 of file Constants.cpp.


Friends And Related Function Documentation

template<class ValType, class TypeClass, class ConstantClass, bool HasLargeKey = false>
void Constant::clearAllValueMaps (  )  [friend]


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