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)
commit3408708548035aa0063fbf2d14915a6fdf267ba2
tree60df6e892bb558393a3a4726a59fa9444a8309de
parentf416d72973fe5a7d2b0acf81a83d52e2e1a85b2c
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225476 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/ValueMapper.cpp
test/Linker/Inputs/distinct.ll [new file with mode: 0644]
test/Linker/distinct.ll [new file with mode: 0644]