Linker: Don't use MDNode::replaceOperandWith()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 7 Jan 2015 21:32:27 +0000 (21:32 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 7 Jan 2015 21:32:27 +0000 (21:32 +0000)
commitc742e3a68d27d14fa9b8dc96066a166499d63b7b
treee5bf236e9931a2edbfdb86de553513cfee4919eb
parentec1494b99f944fd2260b46bb12c3803d1186df69
Linker: Don't use MDNode::replaceOperandWith()

`MDNode::replaceOperandWith()` changes all instances of metadata.  Stop
using it when linking module flags, since (due to uniquing) the flag
values could be used by other metadata.

Instead, use new API `NamedMDNode::setOperand()` to update the reference
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225397 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Metadata.h
lib/IR/Metadata.cpp
lib/Linker/LinkModules.cpp
test/Linker/Inputs/module-flags-dont-change-others.ll [new file with mode: 0644]
test/Linker/module-flags-dont-change-others.ll [new file with mode: 0644]