PATypeHolder is now not a template

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-04-04 19:24:34 +00:00
parent b3afb1f076
commit 61f64f9b6a

View File

@ -57,12 +57,12 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
if (Ty->isPrimitiveType() || if (Ty->isPrimitiveType() ||
isa<OpaqueType>(Ty)) return Ty; // Don't convert primitives isa<OpaqueType>(Ty)) return Ty; // Don't convert primitives
map<const Type *, PATypeHolder<Type> >::iterator I = TypeMap.find(Ty); map<const Type *, PATypeHolder>::iterator I = TypeMap.find(Ty);
if (I != TypeMap.end()) return I->second; if (I != TypeMap.end()) return I->second;
const Type *DestTy = 0; const Type *DestTy = 0;
PATypeHolder<Type> PlaceHolder = OpaqueType::get(); PATypeHolder PlaceHolder = OpaqueType::get();
TypeMap.insert(std::make_pair(Ty, PlaceHolder.get())); TypeMap.insert(std::make_pair(Ty, PlaceHolder.get()));
switch (Ty->getPrimitiveID()) { switch (Ty->getPrimitiveID()) {
@ -226,7 +226,7 @@ void MutateStructTypes::setTransforms(const TransformsType &XForm) {
} }
// Create a new type that corresponds to the destination type // Create a new type that corresponds to the destination type
PATypeHolder<StructType> NSTy = StructType::get(NewType); PATypeHolder NSTy = StructType::get(NewType);
// Refine the old opaque type to the new type to properly handle recursive // Refine the old opaque type to the new type to properly handle recursive
// types... // types...
@ -235,7 +235,8 @@ void MutateStructTypes::setTransforms(const TransformsType &XForm) {
cast<DerivedType>(OldTypeStub)->refineAbstractTypeTo(NSTy); cast<DerivedType>(OldTypeStub)->refineAbstractTypeTo(NSTy);
// Add the transformation to the Transforms map. // Add the transformation to the Transforms map.
Transforms.insert(std::make_pair(OldTy, std::make_pair(NSTy, InVec))); Transforms.insert(std::make_pair(OldTy,
std::make_pair(cast<StructType>(NSTy.get()), InVec)));
DEBUG_MST(cerr << "Mutate " << OldTy << "\nTo " << NSTy << endl); DEBUG_MST(cerr << "Mutate " << OldTy << "\nTo " << NSTy << endl);
} }