@@ -82,8 +82,6 @@ class TypeMapTy : public ValueMapTypeRemapper {
82
82
Type *get (Type *SrcTy);
83
83
Type *get (Type *SrcTy, SmallPtrSet<StructType *, 8 > &Visited);
84
84
85
- void finishType (StructType *DTy, StructType *STy, ArrayRef<Type *> ETypes);
86
-
87
85
FunctionType *get (FunctionType *T) {
88
86
return cast<FunctionType>(get ((Type *)T));
89
87
}
@@ -233,20 +231,6 @@ Error TypeMapTy::linkDefinedTypeBodies() {
233
231
return Error::success ();
234
232
}
235
233
236
- void TypeMapTy::finishType (StructType *DTy, StructType *STy,
237
- ArrayRef<Type *> ETypes) {
238
- DTy->setBody (ETypes, STy->isPacked ());
239
-
240
- // Steal STy's name.
241
- if (STy->hasName ()) {
242
- SmallString<16 > TmpName = STy->getName ();
243
- STy->setName (" " );
244
- DTy->setName (TmpName);
245
- }
246
-
247
- DstStructTypesSet.addNonOpaque (DTy);
248
- }
249
-
250
234
Type *TypeMapTy::get (Type *Ty) {
251
235
SmallPtrSet<StructType *, 8 > Visited;
252
236
return get (Ty, Visited);
@@ -342,8 +326,17 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &Visited) {
342
326
return *Entry = Ty;
343
327
}
344
328
345
- StructType *DTy = StructType::create (Ty->getContext ());
346
- finishType (DTy, STy, ElementTypes);
329
+ StructType *DTy =
330
+ StructType::create (Ty->getContext (), ElementTypes, " " , STy->isPacked ());
331
+
332
+ // Steal STy's name.
333
+ if (STy->hasName ()) {
334
+ SmallString<16 > TmpName = STy->getName ();
335
+ STy->setName (" " );
336
+ DTy->setName (TmpName);
337
+ }
338
+
339
+ DstStructTypesSet.addNonOpaque (DTy);
347
340
return *Entry = DTy;
348
341
}
349
342
}
0 commit comments