Ensure MDNode used as key in metadata linking map cannot be RAUWed
authorTeresa Johnson <tejohnson@google.com>
Wed, 30 Dec 2015 19:32:24 +0000 (19:32 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 30 Dec 2015 19:32:24 +0000 (19:32 +0000)
commitba0fc204633044e6bdaa1416288d9548d74f9d9b
treef6563ab23732844712c671b49b4de1589a3331fe
parent6e198168f880a21713c16701943a2f4b31e47be4
Ensure MDNode used as key in metadata linking map cannot be RAUWed

As suggested in review for r255909, add a way to ensure that temporary
MD used as keys in the MetadataToID map during ThinLTO importing are not
RAUWed.

Add support for marking an MDNode as not replaceable. Clear the new
CanReplace flag when adding a temporary MD node to the MetadataToID map
and clear it when destroying the map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256648 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Metadata.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/IR/Metadata.cpp
lib/Linker/IRMover.cpp