diff options
| author | Eugene Leviant <eleviant@accesssoftek.com> | 2018-01-25 08:35:52 +0000 |
|---|---|---|
| committer | Eugene Leviant <eleviant@accesssoftek.com> | 2018-01-25 08:35:52 +0000 |
| commit | 41e45955bb32d02bce91b1cd2dcf3f0ebedcd062 (patch) | |
| tree | 59c369947f96f446081ad94f736cbf8b231cecc5 /llvm/lib | |
| parent | b369cdbaadb9ed3bc92d51f4361233d065ecdd4b (diff) | |
| download | bcm5719-llvm-41e45955bb32d02bce91b1cd2dcf3f0ebedcd062.tar.gz bcm5719-llvm-41e45955bb32d02bce91b1cd2dcf3f0ebedcd062.zip | |
[IRMover] Add comment and fix test case
llvm-svn: 323407
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index f7170e714b9..6863a895cb1 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -95,6 +95,12 @@ void TypeMapTy::addTypeMapping(Type *DstTy, Type *SrcTy) { for (StructType *Ty : SpeculativeDstOpaqueTypes) DstResolvedOpaqueTypes.erase(Ty); } else { + // SrcTy and DstTy are recursively ismorphic. We clear names of SrcTy + // and all its descendants to lower amount of renaming in LLVM context + // Renaming occurs because we load all source modules to the same context + // and declaration with existing name gets renamed (i.e Foo -> Foo.42). + // As a result we may get several different types in the destination + // module, which are in fact the same. for (Type *Ty : SpeculativeTypes) if (auto *STy = dyn_cast<StructType>(Ty)) if (STy->hasName()) |

