Utils: Keep distinct MDNodes distinct in MapMetadata()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 8 Jan 2015 22:42:30 +0000 (22:42 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 8 Jan 2015 22:42:30 +0000 (22:42 +0000)
commit953e1a48f02031be36094d5bfaf2685cf130bd02
tree6cc3fb579f362928718a30208bbd81e93c7b9332
parent4bbe428cc5d734ac53af9821e6dc0c280d1eeac4
Utils: Keep distinct MDNodes distinct in MapMetadata()

Create new copies of distinct `MDNode`s instead of following the
uniquing `MDNode` logic.

Just like self-references (or other cycles), `MapMetadata()` creates a
new node.  In practice most calls use `RF_NoModuleLevelChanges`, in
which case nothing is duplicated anyway.

Part of PR22111.

llvm-svn: 225476
llvm/lib/Transforms/Utils/ValueMapper.cpp
llvm/test/Linker/Inputs/distinct.ll [new file with mode: 0644]
llvm/test/Linker/distinct.ll [new file with mode: 0644]