diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 0d54c534590ca..c653900c632cc 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -292,17 +292,9 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet &Visited) { AnyChange |= ElementTypes[I] != Ty->getContainedType(I); } - // If we found our type while recursively processing stuff, just use it. + // Refresh Entry after recursively processing stuff. Entry = &MappedTypes[Ty]; - if (*Entry) { - if (auto *DTy = dyn_cast(*Entry)) { - if (DTy->isOpaque()) { - auto *STy = cast(Ty); - finishType(DTy, STy, ElementTypes); - } - } - return *Entry; - } + assert(!*Entry && "Recursive type!"); // If all of the element types mapped directly over and the type is not // a named struct, then the type is usable as-is.