Linker: Don't double-schedule appending variables
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 17 Apr 2016 19:40:20 +0000 (19:40 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 17 Apr 2016 19:40:20 +0000 (19:40 +0000)
commit0fdaf8c9c263857a775f58aa3aac7a94d70f8b5f
treea1413225a4b97dd486cda5cc84f438b87911aec0
parentcaa11696535d1e03ce6be057c514f672498157e8
Linker: Don't double-schedule appending variables

Add an assertion to ValueMapper that prevents double-scheduling of
GlobalValues to remap, and fix the one place it happened.  There are
tons of tests that fail with this assertion in place and without the
code change, so I'm not adding another.

Although it looks related, r266563 was, indeed, removing dead code.
AFAICT, this cross-file double-scheduling started in r266510 when the
cross-file recursion was removed.

llvm-svn: 266569
llvm/lib/Linker/IRMover.cpp
llvm/lib/Transforms/Utils/ValueMapper.cpp