@@ -80,7 +80,6 @@ class TypeMapTy : public ValueMapTypeRemapper {
80
80
// / Return the mapped type to use for the specified input type from the
81
81
// / source module.
82
82
Type *get (Type *SrcTy);
83
- Type *get (Type *SrcTy, SmallPtrSet<StructType *, 8 > &Visited);
84
83
85
84
FunctionType *get (FunctionType *T) {
86
85
return cast<FunctionType>(get ((Type *)T));
@@ -232,11 +231,6 @@ Error TypeMapTy::linkDefinedTypeBodies() {
232
231
}
233
232
234
233
Type *TypeMapTy::get (Type *Ty) {
235
- SmallPtrSet<StructType *, 8 > Visited;
236
- return get (Ty, Visited);
237
- }
238
-
239
- Type *TypeMapTy::get (Type *Ty, SmallPtrSet<StructType *, 8 > &Visited) {
240
234
// If we already have an entry for this type, return it.
241
235
Type **Entry = &MappedTypes[Ty];
242
236
if (*Entry)
@@ -252,11 +246,6 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &Visited) {
252
246
" mapping to a source type" );
253
247
}
254
248
#endif
255
-
256
- if (!Visited.insert (cast<StructType>(Ty)).second ) {
257
- StructType *DTy = StructType::create (Ty->getContext ());
258
- return *Entry = DTy;
259
- }
260
249
}
261
250
262
251
// If this is not a recursive type, then just map all of the elements and
@@ -272,7 +261,7 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &Visited) {
272
261
bool AnyChange = false ;
273
262
ElementTypes.resize (Ty->getNumContainedTypes ());
274
263
for (unsigned I = 0 , E = Ty->getNumContainedTypes (); I != E; ++I) {
275
- ElementTypes[I] = get (Ty->getContainedType (I), Visited );
264
+ ElementTypes[I] = get (Ty->getContainedType (I));
276
265
AnyChange |= ElementTypes[I] != Ty->getContainedType (I);
277
266
}
278
267
0 commit comments