[llvm] [Linker] Remove dead code handling recursive types. NFC. (PR #116652)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 08:40:58 PST 2024
https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/116652
None
>From ef34a38c55bfa8ade830f4bfd2f5fca070339712 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Mon, 18 Nov 2024 16:24:24 +0000
Subject: [PATCH] [Linker] Remove dead code handling recursive types. NFC.
---
llvm/lib/Linker/IRMover.cpp | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
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