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 | 897be2a525c03c3c2331ac5ef74a2e7483434e4d (patch) | |
tree | 220dfe27c3e4ef478a13b1bcc4a8d40a1f65f9e0 /lib/VMCore/Value.cpp | |
parent | b89ac779620ca5fe55c2854dd28fa3b295fb6b69 (diff) | |
download | external_llvm-897be2a525c03c3c2331ac5ef74a2e7483434e4d.zip external_llvm-897be2a525c03c3c2331ac5ef74a2e7483434e4d.tar.gz external_llvm-897be2a525c03c3c2331ac5ef74a2e7483434e4d.tar.bz2 |
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
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r-- | lib/VMCore/Value.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 03b0e6f..ba72af6 100644 --- a/lib/VMCore/Value.cpp +++ b/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; |