Copy metadata when value is RAUW'd. It is debatable whether this is the right approach for custom metadata data in general. However, right now the only custom data user, "dbg", expects this behavior while FE is constructing llvm IR with debug info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-10-13 17:00:54 +00:00
parent 39a38ae529
commit 740d0db812
3 changed files with 17 additions and 0 deletions
+4
View File
@@ -309,6 +309,10 @@ void Value::uncheckedReplaceAllUsesWith(Value *New) {
// Notify all ValueHandles (if present) that this value is going away.
if (HasValueHandle)
ValueHandleBase::ValueIsRAUWd(this, New);
if (HasMetadata) {
LLVMContext &Context = getContext();
Context.pImpl->TheMetadata.ValueIsRAUWd(this, New);
}
while (!use_empty()) {
Use &U = *UseList;