Skip to content
Snippets Groups Projects
Commit 1ed0fa45 authored by Benjamin Kramer's avatar Benjamin Kramer
Browse files

Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move the...

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.

llvm-svn: 157123
parent 1964b6d3
No related branches found
No related tags found
No related merge requests found
......@@ -367,7 +367,7 @@ protected:
CallbackVH(const CallbackVH &RHS)
: ValueHandleBase(Callback, RHS) {}
virtual ~CallbackVH();
virtual ~CallbackVH() {}
void setValPtr(Value *P) {
ValueHandleBase::operator=(P);
......@@ -389,15 +389,13 @@ public:
///
/// All implementations must remove the reference from this object to the
/// Value that's being destroyed.
virtual void deleted() {
setValPtr(NULL);
}
virtual void deleted();
/// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
/// _before_ any of the uses have actually been replaced. If WeakVH were
/// implemented as a CallbackVH, it would use this method to call
/// 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
......
......@@ -686,6 +686,9 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
#endif
}
/// ~CallbackVH. Empty, but defined here to avoid emitting the vtable
/// more than once.
CallbackVH::~CallbackVH() {}
// Default implementation for CallbackVH.
void CallbackVH::allUsesReplacedWith(Value *) {}
void CallbackVH::deleted() {
setValPtr(NULL);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment