aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-04 19:24:34 +0000
committerChris Lattner <sabre@nondot.org>2002-04-04 19:24:34 +0000
commit61f64f9b6a6262a0ee47aa73b23aa5315d5d64b8 (patch)
treed92ca2a2452a6e0388413f2b913dc4fa1809b945
parentb3afb1f07656a1cc222fc65fe10cf62638459994 (diff)
PATypeHolder is now not a template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2106 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/MutateStructTypes.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp
index 641459684f..254588e6aa 100644
--- a/lib/Transforms/IPO/MutateStructTypes.cpp
+++ b/lib/Transforms/IPO/MutateStructTypes.cpp
@@ -57,12 +57,12 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
if (Ty->isPrimitiveType() ||
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;
const Type *DestTy = 0;
- PATypeHolder<Type> PlaceHolder = OpaqueType::get();
+ PATypeHolder PlaceHolder = OpaqueType::get();
TypeMap.insert(std::make_pair(Ty, PlaceHolder.get()));
switch (Ty->getPrimitiveID()) {
@@ -226,7 +226,7 @@ void MutateStructTypes::setTransforms(const TransformsType &XForm) {
}
// 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
// types...
@@ -235,7 +235,8 @@ void MutateStructTypes::setTransforms(const TransformsType &XForm) {
cast<DerivedType>(OldTypeStub)->refineAbstractTypeTo(NSTy);
// 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);
}