HandleBaseKind getKind() const { return PrevPair.getInt(); }
void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
- /// AddToExistingUseList - Add this ValueHandle to the use list for VP,
- /// where List is known to point into the existing use list.
+ /// AddToExistingUseList - Add this ValueHandle to the use list for VP, where
+ /// List is the address of either the head of the list or a Next node within
+ /// the existing use list.
void AddToExistingUseList(ValueHandleBase **List);
+ /// AddToExistingUseListAfter - Add this ValueHandle to the use list after
+ /// Node.
+ void AddToExistingUseListAfter(ValueHandleBase *Node);
+
/// AddToUseList - Add this ValueHandle to the use list for VP.
void AddToUseList();
/// RemoveFromUseList - Remove this ValueHandle from its current use list.
template<> struct simplify_type<AssertingVH<Value> >
: public simplify_type<const AssertingVH<Value> > {};
+// Specialize DenseMapInfo to allow AssertingVH to participate in DenseMap.
+template<typename T>
+struct DenseMapInfo<AssertingVH<T> > {
+ typedef DenseMapInfo<T*> PointerInfo;
+ static inline AssertingVH<T> getEmptyKey() {
+ return AssertingVH<T>(PointerInfo::getEmptyKey());
+ }
+ static inline T* getTombstoneKey() {
+ return AssertingVH<T>(PointerInfo::getTombstoneKey());
+ }
+ static unsigned getHashValue(const AssertingVH<T> &Val) {
+ return PointerInfo::getHashValue(Val);
+ }
+ static bool isEqual(const AssertingVH<T> &LHS, const AssertingVH<T> &RHS) {
+ return LHS == RHS;
+ }
+};
+
+template <typename T>
+struct isPodLike<AssertingVH<T> > {
+#ifdef NDEBUG
+ static const bool value = true;
+#else
+ static const bool value = false;
+#endif
+};
+
+
/// TrackingVH - This is a value handle that tracks a Value (or Value subclass),
/// even across RAUW operations.
///
Value *VP = ValueHandleBase::getValPtr();
// Null is always ok.
- if (!VP)
- return;
+ if (!VP) return;
// Check that this value is valid (i.e., it hasn't been deleted). We
// explicitly delay this check until access to avoid requiring clients to be
ValueTy *getValPtr() const {
CheckValidity();
- return static_cast<ValueTy*>(ValueHandleBase::getValPtr());
+ return (ValueTy*)ValueHandleBase::getValPtr();
}
void setValPtr(ValueTy *P) {
CheckValidity();
/// _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 *new_value) {}
+ virtual void allUsesReplacedWith(Value *) {}
};
// Specialize simplify_type to allow CallbackVH to participate in