Fix ThinLTO crash with debug info
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 3 Sep 2016 21:12:33 +0000 (21:12 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 3 Sep 2016 21:12:33 +0000 (21:12 +0000)
commitebb34348500aa8dd93125e71e36da779339d89a1
tree1b876c337d54ea9cafc65b72315d28d5ed188a78
parent3606d2346cccfb4f6dbb5f7903eeb11ebc151c25
Fix ThinLTO crash with debug info

Because the recent change about ODR type uniquing in the context,
we can reach types defined in another module during IR linking.
This triggered some assertions in case we IR link without starting
from an empty module. To alleviate that, we can self-map metadata
defined in the destination module so that they won't be visited.

Differential Revision: https://reviews.llvm.org/D23841

llvm-svn: 280599
llvm/include/llvm/IR/TypeFinder.h
llvm/lib/Linker/IRMover.cpp
llvm/test/ThinLTO/X86/Inputs/crash_debuginfo.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/crash_debuginfo.ll [new file with mode: 0644]