Linker: Drop superseded subprograms
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 16 Dec 2014 23:23:41 +0000 (23:23 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 16 Dec 2014 23:23:41 +0000 (23:23 +0000)
commitd4017d0489aaa065ce4e0a13f0d21679d6978457
treeb23e76570a120074649b90fa5ad85a51696703ba
parent9ab434750a4cdebacdd369560daf917e9e099ccd
Linker: Drop superseded subprograms

When a function gets replaced by `ModuleLinker`, drop superseded
subprograms.  This ensures that the "first" subprogram pointing at a
function is the same one that `!dbg` references point at.

This is a stop-gap fix for PR21910.  Notably, this fixes Release+Asserts
bootstraps that are currently asserting out in
`LexicalScopes::initialize()` due to the explicit instantiations in
`lib/IR/Dominators.cpp` eventually getting replaced by -argpromotion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224389 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/LinkModules.cpp
test/Linker/Inputs/replaced-function-matches-first-subprogram.ll [new file with mode: 0644]
test/Linker/replaced-function-matches-first-subprogram.ll [new file with mode: 0644]