[llvm] [Linker] Remove dead code handling recursive types. NFC. (PR #116652)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 08:41:33 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lto
Author: Jay Foad (jayfoad)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/116652.diff
1 Files Affected:
- (modified) llvm/lib/Linker/IRMover.cpp (+2-10)
``````````diff
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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/116652
More information about the llvm-commits
mailing list