diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-29 02:53:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-29 02:53:52 +0000 |
commit | a43a3f2379360a766725a4138ee9aff4df41b486 (patch) | |
tree | 82e3170f538d3252efa5f417704375699fceee99 | |
parent | b2406d9895314cbc61183c2fb712cd1a2ddfe7e0 (diff) |
When doing v1->RAUW(v2), don't do anything to metadata. We don't know
why one was replaced with the other. Even in the specific case of
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92241 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Metadata.h | 2 | ||||
-rw-r--r-- | lib/VMCore/Metadata.cpp | 16 | ||||
-rw-r--r-- | lib/VMCore/Value.cpp | 9 |
3 files changed, 0 insertions, 27 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index e63460842e..1f185369a8 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -234,9 +234,7 @@ public: /// ValueIsDeleted - This handler is used to update metadata store /// when a value is deleted. - void ValueIsDeleted(const Value *) {} void ValueIsDeleted(Instruction *Inst); - void ValueIsRAUWd(Value *V1, Value *V2); /// ValueIsCloned - This handler is used to update metadata store /// when In1 is cloned to create In2. diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 8181466608..8fa8d375a1 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -289,7 +289,6 @@ public: void ValueIsDeleted(Instruction *Inst) { removeAllMetadata(Inst); } - void ValueIsRAUWd(Value *V1, Value *V2); /// ValueIsCloned - This handler is used to update metadata store /// when In1 is cloned to create In2. @@ -428,18 +427,6 @@ void MetadataContextImpl::ValueIsCloned(const Instruction *In1, In2->setMetadata(I->first, I->second); } -/// ValueIsRAUWd - This handler is used when V1's all uses are replaced by -/// V2. -void MetadataContextImpl::ValueIsRAUWd(Value *V1, Value *V2) { - Instruction *I1 = dyn_cast<Instruction>(V1); - Instruction *I2 = dyn_cast<Instruction>(V2); - if (!I1 || !I2) - return; - - // FIXME: Give custom handlers a chance to override this. - ValueIsCloned(I1, I2); -} - //===----------------------------------------------------------------------===// // MetadataContext implementation. // @@ -484,9 +471,6 @@ void MetadataContext::getMDKindNames(SmallVectorImpl<StringRef> &N) const { void MetadataContext::ValueIsDeleted(Instruction *Inst) { pImpl->ValueIsDeleted(Inst); } -void MetadataContext::ValueIsRAUWd(Value *V1, Value *V2) { - pImpl->ValueIsRAUWd(V1, V2); -} /// ValueIsCloned - This handler is used to update metadata store /// when In1 is cloned to create In2. diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 0155fa5cfe..fe1219f9a8 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -19,7 +19,6 @@ #include "llvm/Instructions.h" #include "llvm/Operator.h" #include "llvm/Module.h" -#include "llvm/Metadata.h" #include "llvm/ValueSymbolTable.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Debug.h" @@ -302,14 +301,6 @@ void Value::uncheckedReplaceAllUsesWith(Value *New) { if (HasValueHandle) ValueHandleBase::ValueIsRAUWd(this, New); - // FIXME: It doesn't make sense at all for metadata to follow RAUW. - if (Instruction *I = dyn_cast<Instruction>(this)) - if (I->hasMetadata()) { - LLVMContext &Context = getContext(); - // FIXME: NUKE ValueIsRAUWd?? - Context.pImpl->TheMetadata.ValueIsRAUWd(this, New); - } - while (!use_empty()) { Use &U = *UseList; // Must handle Constants specially, we cannot call replaceUsesOfWith on a |