[llvm-commits] [llvm] r92241 - in /llvm/trunk: include/llvm/Metadata.h lib/VMCore/Metadata.cpp lib/VMCore/Value.cpp

Chris Lattner sabre at nondot.org
Mon Dec 28 18:53:52 PST 2009


Author: lattner
Date: Mon Dec 28 20:53:52 2009
New Revision: 92241

URL: http://llvm.org/viewvc/llvm-project?rev=92241&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm/Metadata.h
    llvm/trunk/lib/VMCore/Metadata.cpp
    llvm/trunk/lib/VMCore/Value.cpp

Modified: llvm/trunk/include/llvm/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=92241&r1=92240&r2=92241&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Metadata.h (original)
+++ llvm/trunk/include/llvm/Metadata.h Mon Dec 28 20:53:52 2009
@@ -234,9 +234,7 @@
 
   /// 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.

Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=92241&r1=92240&r2=92241&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Mon Dec 28 20:53:52 2009
@@ -289,7 +289,6 @@
   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 @@
     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::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.

Modified: llvm/trunk/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Value.cpp?rev=92241&r1=92240&r2=92241&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Value.cpp (original)
+++ llvm/trunk/lib/VMCore/Value.cpp Mon Dec 28 20:53:52 2009
@@ -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 @@
   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





More information about the llvm-commits mailing list