summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-05-01 16:28:58 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-05-01 16:28:58 +0000
commit8a6238201f015729a47691c62808a23ec8525096 (patch)
tree30dfa24b8fe0ed4207dd914c1be9e83c14747300 /llvm/lib
parent99dce428bca45663ee9c4a52fbfe6a0c3c1963a7 (diff)
downloadbcm5719-llvm-8a6238201f015729a47691c62808a23ec8525096.tar.gz
bcm5719-llvm-8a6238201f015729a47691c62808a23ec8525096.zip
Emulate TrackingVH using WeakVH
Summary: This frees up one slot in the HandleBaseKind enum, which I will use later to add a new kind of value handle. The size of the HandleBaseKind enum is important because we store a HandleBaseKind in the low two bits of a (in the worst case) 4 byte aligned pointer. Reviewers: davide, chandlerc Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D32634 llvm-svn: 301809
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Value.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 906c5d33535..2ce0a2ecf2b 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -820,11 +820,6 @@ void ValueHandleBase::ValueIsDeleted(Value *V) {
switch (Entry->getKind()) {
case Assert:
break;
- case Tracking:
- // Mark that this value has been deleted by setting it to an invalid Value
- // pointer.
- Entry->operator=(DenseMapInfo<Value *>::getTombstoneKey());
- break;
case Weak:
// Weak just goes to null, which will unlink it from the list.
Entry->operator=(nullptr);
@@ -876,13 +871,6 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
case Assert:
// Asserting handle does not follow RAUW implicitly.
break;
- case Tracking:
- // Tracking goes to new value like a WeakVH. Note that this may make it
- // something incompatible with its templated type. We don't want to have a
- // virtual (or inline) interface to handle this though, so instead we make
- // the TrackingVH accessors guarantee that a client never sees this value.
-
- LLVM_FALLTHROUGH;
case Weak:
// Weak goes to the new value, which will unlink it from Old's list.
Entry->operator=(New);
@@ -895,18 +883,17 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) {
}
#ifndef NDEBUG
- // If any new tracking or weak value handles were added while processing the
+ // If any new weak value handles were added while processing the
// list, then complain about it now.
if (Old->HasValueHandle)
for (Entry = pImpl->ValueHandles[Old]; Entry; Entry = Entry->Next)
switch (Entry->getKind()) {
- case Tracking:
case Weak:
dbgs() << "After RAUW from " << *Old->getType() << " %"
<< Old->getName() << " to " << *New->getType() << " %"
<< New->getName() << "\n";
- llvm_unreachable("A tracking or weak value handle still pointed to the"
- " old value!\n");
+ llvm_unreachable(
+ "A weak value handle still pointed to the old value!\n");
default:
break;
}
OpenPOWER on IntegriCloud