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)
commit875902689353d92ee3ff49fccb3412b2656176c7
tree49f358a8b2e7ef43211f177b4ebefae087d3fb7b
parentd52186ff5a397bb2335e6ee14ab37ead2bac3b67
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.

llvm-svn: 224389
llvm/lib/Linker/LinkModules.cpp
llvm/test/Linker/Inputs/replaced-function-matches-first-subprogram.ll [new file with mode: 0644]
llvm/test/Linker/replaced-function-matches-first-subprogram.ll [new file with mode: 0644]