Add a TrackingVH value handle.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 02:02:33 +0000 (02:02 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 22 Sep 2009 02:02:33 +0000 (02:02 +0000)
commite5b18362dbafc8ee44ae864664fffe47066f685a
tree9c205f4fef1b148ea8ac352c7c50f2c71cb0fddc
parent014d624a2864605b10d3b14fd9cda3163c41f6bf
Add a TrackingVH value handle.

This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type.

For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class.

The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82506 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/ValueHandle.h
lib/VMCore/Value.cpp