mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move the other virtual methods out of line as they are only called from within Value.cpp anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -367,7 +367,7 @@ protected:
|
|||||||
CallbackVH(const CallbackVH &RHS)
|
CallbackVH(const CallbackVH &RHS)
|
||||||
: ValueHandleBase(Callback, RHS) {}
|
: ValueHandleBase(Callback, RHS) {}
|
||||||
|
|
||||||
virtual ~CallbackVH();
|
virtual ~CallbackVH() {}
|
||||||
|
|
||||||
void setValPtr(Value *P) {
|
void setValPtr(Value *P) {
|
||||||
ValueHandleBase::operator=(P);
|
ValueHandleBase::operator=(P);
|
||||||
@@ -389,15 +389,13 @@ public:
|
|||||||
///
|
///
|
||||||
/// All implementations must remove the reference from this object to the
|
/// All implementations must remove the reference from this object to the
|
||||||
/// Value that's being destroyed.
|
/// Value that's being destroyed.
|
||||||
virtual void deleted() {
|
virtual void deleted();
|
||||||
setValPtr(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
|
/// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
|
||||||
/// _before_ any of the uses have actually been replaced. If WeakVH were
|
/// _before_ any of the uses have actually been replaced. If WeakVH were
|
||||||
/// implemented as a CallbackVH, it would use this method to call
|
/// implemented as a CallbackVH, it would use this method to call
|
||||||
/// setValPtr(new_value). AssertingVH would do nothing in this method.
|
/// setValPtr(new_value). AssertingVH would do nothing in this method.
|
||||||
virtual void allUsesReplacedWith(Value *) {}
|
virtual void allUsesReplacedWith(Value *);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Specialize simplify_type to allow CallbackVH to participate in
|
// Specialize simplify_type to allow CallbackVH to participate in
|
||||||
|
@@ -686,6 +686,9 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ~CallbackVH. Empty, but defined here to avoid emitting the vtable
|
// Default implementation for CallbackVH.
|
||||||
/// more than once.
|
void CallbackVH::allUsesReplacedWith(Value *) {}
|
||||||
CallbackVH::~CallbackVH() {}
|
|
||||||
|
void CallbackVH::deleted() {
|
||||||
|
setValPtr(NULL);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user