[llvm-commits] [llvm] r85344 - in /llvm/trunk/lib/VMCore: ConstantsContext.h LLVMContextImpl.h
Jeffrey Yasskin
jyasskin at google.com
Tue Oct 27 16:45:55 PDT 2009
Author: jyasskin
Date: Tue Oct 27 18:45:55 2009
New Revision: 85344
URL: http://llvm.org/viewvc/llvm-project?rev=85344&view=rev
Log:
Rename lib/VMCore/ConstantsContext.h:ValueMap<> to ConstantUniqueMap<> to avoid
colliding with llvm/ADT/ValueMap.h:ValueMap<>.
Modified:
llvm/trunk/lib/VMCore/ConstantsContext.h
llvm/trunk/lib/VMCore/LLVMContextImpl.h
Modified: llvm/trunk/lib/VMCore/ConstantsContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantsContext.h?rev=85344&r1=85343&r2=85344&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/ConstantsContext.h (original)
+++ llvm/trunk/lib/VMCore/ConstantsContext.h Tue Oct 27 18:45:55 2009
@@ -332,7 +332,7 @@
// The number of operands for each ConstantCreator::create method is
// determined by the ConstantTraits template.
// ConstantCreator - A class that is used to create constants by
-// ValueMap*. This class should be partially specialized if there is
+// ConstantUniqueMap*. This class should be partially specialized if there is
// something strange that needs to be done to interface to the ctor for the
// constant.
//
@@ -506,7 +506,7 @@
template<class ValType, class TypeClass, class ConstantClass,
bool HasLargeKey = false /*true for arrays and structs*/ >
-class ValueMap : public AbstractTypeUser {
+class ConstantUniqueMap : public AbstractTypeUser {
public:
typedef std::pair<const TypeClass*, ValType> MapKey;
typedef std::map<MapKey, ConstantClass *> MapTy;
@@ -529,8 +529,8 @@
///
AbstractTypeMapTy AbstractTypeMap;
- /// ValueMapLock - Mutex for this map.
- sys::SmartMutex<true> ValueMapLock;
+ /// ConstantUniqueMapLock - Mutex for this map.
+ sys::SmartMutex<true> ConstantUniqueMapLock;
public:
// NOTE: This function is not locked. It is the caller's responsibility
@@ -619,7 +619,7 @@
/// getOrCreate - Return the specified constant from the map, creating it if
/// necessary.
ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) {
- sys::SmartScopedLock<true> Lock(ValueMapLock);
+ sys::SmartScopedLock<true> Lock(ConstantUniqueMapLock);
MapKey Lookup(Ty, V);
ConstantClass* Result = 0;
@@ -674,7 +674,7 @@
}
void remove(ConstantClass *CP) {
- sys::SmartScopedLock<true> Lock(ValueMapLock);
+ sys::SmartScopedLock<true> Lock(ConstantUniqueMapLock);
typename MapTy::iterator I = FindExistingElement(CP);
assert(I != Map.end() && "Constant not found in constant table!");
assert(I->second == CP && "Didn't find correct element?");
@@ -725,7 +725,7 @@
}
void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
- sys::SmartScopedLock<true> Lock(ValueMapLock);
+ sys::SmartScopedLock<true> Lock(ConstantUniqueMapLock);
typename AbstractTypeMapTy::iterator I = AbstractTypeMap.find(OldTy);
assert(I != AbstractTypeMap.end() &&
@@ -778,7 +778,7 @@
}
void dump() const {
- DEBUG(errs() << "Constant.cpp: ValueMap\n");
+ DEBUG(errs() << "Constant.cpp: ConstantUniqueMap\n");
}
};
Modified: llvm/trunk/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContextImpl.h?rev=85344&r1=85343&r2=85344&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/VMCore/LLVMContextImpl.h Tue Oct 27 18:45:55 2009
@@ -108,25 +108,25 @@
FoldingSet<MDNode> MDNodeSet;
- ValueMap<char, Type, ConstantAggregateZero> AggZeroConstants;
+ ConstantUniqueMap<char, Type, ConstantAggregateZero> AggZeroConstants;
- typedef ValueMap<std::vector<Constant*>, ArrayType,
+ typedef ConstantUniqueMap<std::vector<Constant*>, ArrayType,
ConstantArray, true /*largekey*/> ArrayConstantsTy;
ArrayConstantsTy ArrayConstants;
- typedef ValueMap<std::vector<Constant*>, StructType,
- ConstantStruct, true /*largekey*/> StructConstantsTy;
+ typedef ConstantUniqueMap<std::vector<Constant*>, StructType,
+ ConstantStruct, true /*largekey*/> StructConstantsTy;
StructConstantsTy StructConstants;
- typedef ValueMap<std::vector<Constant*>, VectorType,
- ConstantVector> VectorConstantsTy;
+ typedef ConstantUniqueMap<std::vector<Constant*>, VectorType,
+ ConstantVector> VectorConstantsTy;
VectorConstantsTy VectorConstants;
- ValueMap<char, PointerType, ConstantPointerNull> NullPtrConstants;
+ ConstantUniqueMap<char, PointerType, ConstantPointerNull> NullPtrConstants;
- ValueMap<char, Type, UndefValue> UndefValueConstants;
+ ConstantUniqueMap<char, Type, UndefValue> UndefValueConstants;
- ValueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants;
+ ConstantUniqueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants;
ConstantInt *TheTrueVal;
ConstantInt *TheFalseVal;
More information about the llvm-commits
mailing list