[llvm] 3d172f3 - [Linker] Remove dead code handling recursive types. NFC. (#116652)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 12:10:04 PST 2024
Author: Jay Foad
Date: 2024-11-18T20:10:01Z
New Revision: 3d172f3dff25ce70f7158330ac4068e48e2b364d
URL: https://github.com/llvm/llvm-project/commit/3d172f3dff25ce70f7158330ac4068e48e2b364d
DIFF: https://github.com/llvm/llvm-project/commit/3d172f3dff25ce70f7158330ac4068e48e2b364d.diff
LOG: [Linker] Remove dead code handling recursive types. NFC. (#116652)
Added:
Modified:
llvm/lib/Linker/IRMover.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index 0d54c534590ca9..c653900c632cc9 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -292,17 +292,9 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &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<StructType>(*Entry)) {
- if (DTy->isOpaque()) {
- auto *STy = cast<StructType>(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.
More information about the llvm-commits
mailing list