diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-13 17:00:54 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-13 17:00:54 +0000 |
commit | e6f26a74153ba66553e836d75f7beb7ae09b102e (patch) | |
tree | 3290aabe52b59c28cf6d2e219cabfb4692f1ede9 /llvm/lib/VMCore/Value.cpp | |
parent | fc460554f6d115026bdb89919f8171de2b4adc18 (diff) | |
download | bcm5719-llvm-e6f26a74153ba66553e836d75f7beb7ae09b102e.tar.gz bcm5719-llvm-e6f26a74153ba66553e836d75f7beb7ae09b102e.zip |
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.
llvm-svn: 83977
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r-- | llvm/lib/VMCore/Value.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 03b0e6f172e..ba72af635cd 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -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; |