[llvm-commits] [llvm] r83704 - /llvm/trunk/include/llvm/Support/ValueHandle.h

Chris Lattner sabre at nondot.org
Sat Oct 10 01:27:29 PDT 2009


Author: lattner
Date: Sat Oct 10 03:27:29 2009
New Revision: 83704

URL: http://llvm.org/viewvc/llvm-project?rev=83704&view=rev
Log:
add some WeakVH::operator='s.  Without these, assigning
a Value* to a WeakVH was constructing a temporary WeakVH
(due to the implicit assignment operator).  This avoids
that cost.

Modified:
    llvm/trunk/include/llvm/Support/ValueHandle.h

Modified: llvm/trunk/include/llvm/Support/ValueHandle.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ValueHandle.h?rev=83704&r1=83703&r2=83704&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/ValueHandle.h (original)
+++ llvm/trunk/include/llvm/Support/ValueHandle.h Sat Oct 10 03:27:29 2009
@@ -54,6 +54,8 @@
   PointerIntPair<ValueHandleBase**, 2, HandleBaseKind> PrevPair;
   ValueHandleBase *Next;
   Value *VP;
+  
+  explicit ValueHandleBase(const ValueHandleBase&); // DO NOT IMPLEMENT.
 public:
   explicit ValueHandleBase(HandleBaseKind Kind)
     : PrevPair(0, Kind), Next(0), VP(0) {}
@@ -131,6 +133,13 @@
   WeakVH(const WeakVH &RHS)
     : ValueHandleBase(Weak, RHS) {}
 
+  Value *operator=(Value *RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+  Value *operator=(const ValueHandleBase &RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+
   operator Value*() const {
     return getValPtr();
   }





More information about the llvm-commits mailing list