Skip to content

Commit 3d172f3

Browse files
authored
[Linker] Remove dead code handling recursive types. NFC. (#116652)
1 parent 842fd15 commit 3d172f3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/Linker/IRMover.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,17 +292,9 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &Visited) {
292292
AnyChange |= ElementTypes[I] != Ty->getContainedType(I);
293293
}
294294

295-
// If we found our type while recursively processing stuff, just use it.
295+
// Refresh Entry after recursively processing stuff.
296296
Entry = &MappedTypes[Ty];
297-
if (*Entry) {
298-
if (auto *DTy = dyn_cast<StructType>(*Entry)) {
299-
if (DTy->isOpaque()) {
300-
auto *STy = cast<StructType>(Ty);
301-
finishType(DTy, STy, ElementTypes);
302-
}
303-
}
304-
return *Entry;
305-
}
297+
assert(!*Entry && "Recursive type!");
306298

307299
// If all of the element types mapped directly over and the type is not
308300
// a named struct, then the type is usable as-is.

0 commit comments

Comments
 (0)