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.

llvm-svn: 83704
This commit is contained in:
Chris Lattner 2009-10-10 08:27:29 +00:00
parent a0424f5372
commit 71db463fcf
1 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,8 @@ private:
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 @@ public:
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();
}