aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-02 21:10:48 +0000
committerDan Gohman <gohman@apple.com>2009-05-02 21:10:48 +0000
commit29bcef8a7ac2f910540003a0edcdc037a56d7ba3 (patch)
treef6751e459b0d08676798384a220ebba5b6461a88 /lib/VMCore
parentd12141b1feec631057a68343a01c66dab9b9c640 (diff)
downloadexternal_llvm-29bcef8a7ac2f910540003a0edcdc037a56d7ba3.zip
external_llvm-29bcef8a7ac2f910540003a0edcdc037a56d7ba3.tar.gz
external_llvm-29bcef8a7ac2f910540003a0edcdc037a56d7ba3.tar.bz2
Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from me
to make the copy constructor and destructor protected, and corresponding adjustments to the unittests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Value.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index af3f4e7..35c8ccf 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -511,7 +511,9 @@ void ValueHandleBase::ValueIsDeleted(Value *V) {
ThisNode->operator=(0);
break;
case Callback:
- assert(0 && "Callback not implemented yet!");
+ // Forward to the subclass's implementation.
+ static_cast<CallbackVH*>(ThisNode)->deleted();
+ break;
}
}
@@ -543,11 +545,17 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
ThisNode->operator=(New);
break;
case Callback:
- assert(0 && "Callback not implemented yet!");
+ // Forward to the subclass's implementation.
+ static_cast<CallbackVH*>(ThisNode)->allUsesReplacedWith(New);
+ break;
}
}
}
+/// ~CallbackVH. Empty, but defined here to avoid emitting the vtable
+/// more than once.
+CallbackVH::~CallbackVH() {}
+
//===----------------------------------------------------------------------===//
// User Class