Add back r222727 with a fix.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 28 Nov 2014 16:41:24 +0000 (16:41 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 28 Nov 2014 16:41:24 +0000 (16:41 +0000)
commitf716393db9f56721a1d712ef863a6853df8b7567
tree6c1feb15e3b608c65a0ad51f0fee399f16515710
parentfdf80986787055d0448d55e589b13bb95a3b0ced
Add back r222727 with a fix.

The original patch would fail when:

* A dst opaque type (%A) is matched with a src type (%A).
* A src opaque (%E) type is then speculatively matched with %A and the
  speculation fails afterward.
* When rolling back the speculation we would cancel the source %A to dest
  %A mapping.

The fix is to keep an explicit list of which resolutions are speculative.

Original message:

Fix overly aggressive type merging.

If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222923 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/LinkModules.cpp
test/Linker/Inputs/type-unique-opaque.ll [new file with mode: 0644]
test/Linker/type-unique-opaque.ll [new file with mode: 0644]