LLVM 23.0.0git
ValueHandle.h
Go to the documentation of this file.
1//===- ValueHandle.h - Value Smart Pointer classes --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the ValueHandle class and its sub-classes.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_IR_VALUEHANDLE_H
14#define LLVM_IR_VALUEHANDLE_H
15
18#include "llvm/IR/Value.h"
21#include <cassert>
22
23namespace llvm {
24
25/// This is the common base class of value handles.
26///
27/// ValueHandle's are smart pointers to Value's that have special behavior when
28/// the value is deleted or ReplaceAllUsesWith'd. See the specific handles
29/// below for details.
31 friend class Value;
32 template <typename ValueTy> friend class PoisoningVH;
33
34protected:
35 /// This indicates what sub class the handle actually is.
36 ///
37 /// This is to avoid having a vtable for the light-weight handle pointers. The
38 /// fully general Callback version does have a vtable.
40
42 : ValueHandleBase(RHS.PrevPair.getInt(), RHS) {}
43
45 : PrevPair(nullptr, Kind), Val(RHS.getValPtr()) {
46 if (isValid(getValPtr()))
47 AddToExistingUseList(RHS.getPrevPtr());
48 }
49
51 : PrevPair(nullptr, Kind), Val(RHS.getValPtr()) {
52 if (isValid(getValPtr())) {
53 AddToExistingUseList(RHS.getPrevPtr());
54 RHS.RemoveFromUseList();
55 RHS.clearValPtr();
56 }
57 }
58
59private:
61 ValueHandleBase *Next = nullptr;
62 Value *Val = nullptr;
63
64 void setValPtr(Value *V) { Val = V; }
65
66public:
68 : PrevPair(nullptr, Kind) {}
70 : PrevPair(nullptr, Kind), Val(V) {
71 if (isValid(getValPtr()))
72 AddToUseList();
73 }
74
79
81 if (getValPtr() == RHS)
82 return RHS;
83 if (isValid(getValPtr()))
85 setValPtr(RHS);
86 if (isValid(getValPtr()))
87 AddToUseList();
88 return RHS;
89 }
90
92 if (getValPtr() == RHS.getValPtr())
93 return RHS.getValPtr();
94 if (isValid(getValPtr()))
96 setValPtr(RHS.getValPtr());
97 if (isValid(getValPtr()))
98 AddToExistingUseList(RHS.getPrevPtr());
99 return getValPtr();
100 }
101
103 if (getValPtr() == RHS.getValPtr()) {
104 if (this != &RHS) {
105 if (isValid(RHS.getValPtr()))
106 RHS.RemoveFromUseList();
107 RHS.clearValPtr();
108 }
109 return getValPtr();
110 }
111 if (isValid(getValPtr()))
113 setValPtr(RHS.getValPtr());
114 if (isValid(getValPtr())) {
115 AddToExistingUseList(RHS.getPrevPtr());
116 RHS.RemoveFromUseList();
117 RHS.clearValPtr();
118 }
119 return getValPtr();
120 }
121
122 Value *operator->() const { return getValPtr(); }
123 Value &operator*() const {
124 Value *V = getValPtr();
125 assert(V && "Dereferencing deleted ValueHandle");
126 return *V;
127 }
128
129protected:
130 Value *getValPtr() const { return Val; }
131
132 static bool isValid(Value *V) {
133 return V &&
136 }
137
138 /// Remove this ValueHandle from its current use list.
140
141 /// Clear the underlying pointer without clearing the use list.
142 ///
143 /// This should only be used if a derived class has manually removed the
144 /// handle from the use list.
145 void clearValPtr() { setValPtr(nullptr); }
146
147public:
148 // Callbacks made from Value.
149 LLVM_ABI static void ValueIsDeleted(Value *V);
150 LLVM_ABI static void ValueIsRAUWd(Value *Old, Value *New);
151
152private:
153 // Internal implementation details.
154 ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
155 HandleBaseKind getKind() const { return PrevPair.getInt(); }
156 void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
157
158 /// Add this ValueHandle to the use list for V.
159 ///
160 /// List is the address of either the head of the list or a Next node within
161 /// the existing use list.
162 LLVM_ABI void AddToExistingUseList(ValueHandleBase **List);
163
164 /// Add this ValueHandle to the use list after Node.
165 void AddToExistingUseListAfter(ValueHandleBase *Node);
166
167 /// Add this ValueHandle to the use list for V.
168 LLVM_ABI void AddToUseList();
169};
170
171/// A nullable Value handle that is nullable.
172///
173/// This is a value handle that points to a value, and nulls itself
174/// out if that value is deleted.
175class WeakVH : public ValueHandleBase {
176public:
181
182 WeakVH &operator=(const WeakVH &RHS) = default;
183
190
191 operator Value*() const {
192 return getValPtr();
193 }
194};
195
196// Specialize simplify_type to allow WeakVH to participate in
197// dyn_cast, isa, etc.
198template <> struct simplify_type<WeakVH> {
199 using SimpleType = Value *;
200
201 static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
202};
203template <> struct simplify_type<const WeakVH> {
204 using SimpleType = Value *;
205
206 static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
207};
208
209// Specialize DenseMapInfo to allow WeakVH to participate in DenseMap.
210template <> struct DenseMapInfo<WeakVH> {
211 static inline WeakVH getEmptyKey() {
213 }
214
218
219 static unsigned getHashValue(const WeakVH &Val) {
221 }
222
223 static bool isEqual(const WeakVH &LHS, const WeakVH &RHS) {
225 }
226};
227
228/// Value handle that is nullable, but tries to track the Value.
229///
230/// This is a value handle that tries hard to point to a Value, even across
231/// RAUW operations, but will null itself out if the value is destroyed. this
232/// is useful for advisory sorts of information, but should not be used as the
233/// key of a map (since the map would have to rearrange itself when the pointer
234/// changes).
259
260// Specialize simplify_type to allow WeakTrackingVH to participate in
261// dyn_cast, isa, etc.
262template <> struct simplify_type<WeakTrackingVH> {
263 using SimpleType = Value *;
264
265 static SimpleType getSimplifiedValue(WeakTrackingVH &WVH) { return WVH; }
266};
267template <> struct simplify_type<const WeakTrackingVH> {
268 using SimpleType = Value *;
269
271 return WVH;
272 }
273};
274
275/// Value handle that asserts if the Value is deleted.
276///
277/// This is a Value Handle that points to a value and asserts out if the value
278/// is destroyed while the handle is still live. This is very useful for
279/// catching dangling pointer bugs and other things which can be non-obvious.
280/// One particularly useful place to use this is as the Key of a map. Dangling
281/// pointer bugs often lead to really subtle bugs that only occur if another
282/// object happens to get allocated to the same address as the old one. Using
283/// an AssertingVH ensures that an assert is triggered as soon as the bad
284/// delete occurs.
285///
286/// Note that an AssertingVH handle does *not* follow values across RAUW
287/// operations. This means that RAUW's need to explicitly update the
288/// AssertingVH's as it moves. This is required because in non-assert mode this
289/// class turns into a trivial wrapper around a pointer.
290template <typename ValueTy>
292#if LLVM_ENABLE_ABI_BREAKING_CHECKS
293 : public ValueHandleBase
294#endif
295{
296 friend struct DenseMapInfo<AssertingVH<ValueTy>>;
297
298#if LLVM_ENABLE_ABI_BREAKING_CHECKS
299 Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
300 void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
301#else
302 Value *ThePtr;
303 Value *getRawValPtr() const { return ThePtr; }
304 void setRawValPtr(Value *P) { ThePtr = P; }
305#endif
306 // Convert a ValueTy*, which may be const, to the raw Value*.
307 static Value *GetAsValue(Value *V) { return V; }
308 static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
309
310 ValueTy *getValPtr() const { return static_cast<ValueTy *>(getRawValPtr()); }
311 void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
312
313public:
314#if LLVM_ENABLE_ABI_BREAKING_CHECKS
315 AssertingVH() : ValueHandleBase(Assert) {}
316 AssertingVH(ValueTy *P) : ValueHandleBase(Assert, GetAsValue(P)) {}
317 AssertingVH(const AssertingVH &RHS) : ValueHandleBase(Assert, RHS) {}
318 AssertingVH(AssertingVH &&RHS) : ValueHandleBase(Assert, std::move(RHS)) {}
319#else
320 AssertingVH() : ThePtr(nullptr) {}
321 AssertingVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
322 AssertingVH(const AssertingVH &) = default;
323 AssertingVH(AssertingVH &&RHS) : ThePtr(std::exchange(RHS.ThePtr, nullptr)) {}
324#endif
325
326 operator ValueTy*() const {
327 return getValPtr();
328 }
329
330 ValueTy *operator=(ValueTy *RHS) {
331 setValPtr(RHS);
332 return getValPtr();
333 }
335 setValPtr(RHS.getValPtr());
336 return getValPtr();
337 }
338#if LLVM_ENABLE_ABI_BREAKING_CHECKS
341 return getValPtr();
342 }
343#else
345 ThePtr = std::exchange(RHS.ThePtr, nullptr);
346 return getValPtr();
347 }
348#endif
349
350 ValueTy *operator->() const { return getValPtr(); }
351 ValueTy &operator*() const { return *getValPtr(); }
352};
353
354// Treat AssertingVH<T> like T* inside maps. This also allows using find_as()
355// to look up a value without constructing a value handle.
356template<typename T>
358
359/// Value handle that tracks a Value across RAUW.
360///
361/// TrackingVH is designed for situations where a client needs to hold a handle
362/// to a Value (or subclass) across some operations which may move that value,
363/// but should never destroy it or replace it with some unacceptable type.
364///
365/// It is an error to attempt to replace a value with one of a type which is
366/// incompatible with any of its outstanding TrackingVHs.
367///
368/// It is an error to read from a TrackingVH that does not point to a valid
369/// value. A TrackingVH is said to not point to a valid value if either it
370/// hasn't yet been assigned a value yet or because the value it was tracking
371/// has since been deleted.
372///
373/// Assigning a value to a TrackingVH is always allowed, even if said TrackingVH
374/// no longer points to a valid value.
375template <typename ValueTy> class TrackingVH {
376 WeakTrackingVH InnerHandle;
377
378public:
379 ValueTy *getValPtr() const {
380 assert(InnerHandle.pointsToAliveValue() &&
381 "TrackingVH must be non-null and valid on dereference!");
382
383 // Check that the value is a member of the correct subclass. We would like
384 // to check this property on assignment for better debugging, but we don't
385 // want to require a virtual interface on this VH. Instead we allow RAUW to
386 // replace this value with a value of an invalid type, and check it here.
387 assert(isa<ValueTy>(InnerHandle) &&
388 "Tracked Value was replaced by one with an invalid type!");
389 return cast<ValueTy>(InnerHandle);
390 }
391
392 void setValPtr(ValueTy *P) {
393 // Assigning to non-valid TrackingVH's are fine so we just unconditionally
394 // assign here.
395 InnerHandle = GetAsValue(P);
396 }
397
398 // Convert a ValueTy*, which may be const, to the type the base
399 // class expects.
400 static Value *GetAsValue(Value *V) { return V; }
401 static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
402
403public:
404 TrackingVH() = default;
405 TrackingVH(ValueTy *P) { setValPtr(P); }
406
407 operator ValueTy*() const {
408 return getValPtr();
409 }
410
411 ValueTy *operator=(ValueTy *RHS) {
412 setValPtr(RHS);
413 return getValPtr();
414 }
415
416 ValueTy *operator->() const { return getValPtr(); }
417 ValueTy &operator*() const { return *getValPtr(); }
418};
419
420/// Value handle with callbacks on RAUW and destruction.
421///
422/// This is a value handle that allows subclasses to define callbacks that run
423/// when the underlying Value has RAUW called on it or is destroyed. This
424/// class can be used as the key of a map, as long as the user takes it out of
425/// the map before calling setValPtr() (since the map has to rearrange itself
426/// when the pointer changes). Unlike ValueHandleBase, this class has a vtable.
428 virtual void anchor();
429protected:
430 ~CallbackVH() = default;
431 CallbackVH(const CallbackVH &) = default;
432 CallbackVH &operator=(const CallbackVH &) = default;
433
437
438public:
441 CallbackVH(const Value *P) : CallbackVH(const_cast<Value *>(P)) {}
442
443 operator Value*() const {
444 return getValPtr();
445 }
446
447 /// Callback for Value destruction.
448 ///
449 /// Called when this->getValPtr() is destroyed, inside ~Value(), so you
450 /// may call any non-virtual Value method on getValPtr(), but no subclass
451 /// methods. If WeakTrackingVH were implemented as a CallbackVH, it would use
452 /// this
453 /// method to call setValPtr(NULL). AssertingVH would use this method to
454 /// cause an assertion failure.
455 ///
456 /// All implementations must remove the reference from this object to the
457 /// Value that's being destroyed.
458 virtual void deleted() { setValPtr(nullptr); }
459
460 /// Callback for Value RAUW.
461 ///
462 /// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
463 /// _before_ any of the uses have actually been replaced. If WeakTrackingVH
464 /// were
465 /// implemented as a CallbackVH, it would use this method to call
466 /// setValPtr(new_value). AssertingVH would do nothing in this method.
467 virtual void allUsesReplacedWith(Value *) {}
468};
469
470/// Value handle that poisons itself if the Value is deleted.
471///
472/// This is a Value Handle that points to a value and poisons itself if the
473/// value is destroyed while the handle is still live. This is very useful for
474/// catching dangling pointer bugs where an \c AssertingVH cannot be used
475/// because the dangling handle needs to outlive the value without ever being
476/// used.
477///
478/// One particularly useful place to use this is as the Key of a map. Dangling
479/// pointer bugs often lead to really subtle bugs that only occur if another
480/// object happens to get allocated to the same address as the old one. Using
481/// a PoisoningVH ensures that an assert is triggered if looking up a new value
482/// in the map finds a handle from the old value.
483///
484/// Note that a PoisoningVH handle does *not* follow values across RAUW
485/// operations. This means that RAUW's need to explicitly update the
486/// PoisoningVH's as it moves. This is required because in non-assert mode this
487/// class turns into a trivial wrapper around a pointer.
488template <typename ValueTy>
489class PoisoningVH final
490#if LLVM_ENABLE_ABI_BREAKING_CHECKS
491 : public CallbackVH
492#endif
493{
494 friend struct DenseMapInfo<PoisoningVH<ValueTy>>;
495
496 // Convert a ValueTy*, which may be const, to the raw Value*.
497 static Value *GetAsValue(Value *V) { return V; }
498 static Value *GetAsValue(const Value *V) { return const_cast<Value *>(V); }
499
500#if LLVM_ENABLE_ABI_BREAKING_CHECKS
501 /// A flag tracking whether this value has been poisoned.
502 ///
503 /// On delete and RAUW, we leave the value pointer alone so that as a raw
504 /// pointer it produces the same value (and we fit into the same key of
505 /// a hash table, etc), but we poison the handle so that any top-level usage
506 /// will fail.
507 bool Poisoned = false;
508
509 Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
510 void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
511
512 /// Handle deletion by poisoning the handle.
513 void deleted() override {
514 assert(!Poisoned && "Tried to delete an already poisoned handle!");
515 Poisoned = true;
516 RemoveFromUseList();
517 }
518
519 /// Handle RAUW by poisoning the handle.
520 void allUsesReplacedWith(Value *) override {
521 assert(!Poisoned && "Tried to RAUW an already poisoned handle!");
522 Poisoned = true;
523 RemoveFromUseList();
524 }
525#else // LLVM_ENABLE_ABI_BREAKING_CHECKS
526 Value *ThePtr = nullptr;
527
528 Value *getRawValPtr() const { return ThePtr; }
529 void setRawValPtr(Value *P) { ThePtr = P; }
530#endif
531
532 ValueTy *getValPtr() const {
533#if LLVM_ENABLE_ABI_BREAKING_CHECKS
534 assert(!Poisoned && "Accessed a poisoned value handle!");
535#endif
536 return static_cast<ValueTy *>(getRawValPtr());
537 }
538 void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
539
540public:
541 PoisoningVH() = default;
542#if LLVM_ENABLE_ABI_BREAKING_CHECKS
543 PoisoningVH(ValueTy *P) : CallbackVH(GetAsValue(P)) {}
544 // A poisoned handle is detached from its use list but keeps its raw value
545 // pointer, so its use-list pointers are stale; a copy must not relink through
546 // them.
547 PoisoningVH(const PoisoningVH &RHS) : CallbackVH(), Poisoned(RHS.Poisoned) {
548 if (Poisoned)
549 ValueHandleBase::setValPtr(RHS.getRawValPtr());
550 else
551 setRawValPtr(RHS.getRawValPtr());
552 }
553
554 ~PoisoningVH() {
555 if (Poisoned)
556 clearValPtr();
557 }
558
559 PoisoningVH &operator=(const PoisoningVH &RHS) {
560 if (Poisoned)
561 clearValPtr();
562 if (RHS.Poisoned) {
563 // Detach *this and copy only the raw pointer; see the copy constructor.
564 if (isValid(getRawValPtr()))
565 RemoveFromUseList();
566 ValueHandleBase::setValPtr(RHS.getRawValPtr());
567 } else {
569 }
570 Poisoned = RHS.Poisoned;
571 return *this;
572 }
573#else
574 PoisoningVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
575#endif
576
577 operator ValueTy *() const { return getValPtr(); }
578
579 ValueTy *operator->() const { return getValPtr(); }
580 ValueTy &operator*() const { return *getValPtr(); }
581};
582
583// Specialize DenseMapInfo to allow PoisoningVH to participate in DenseMap.
584template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
585 static inline PoisoningVH<T> getEmptyKey() {
586 PoisoningVH<T> Res;
587 Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
588 return Res;
589 }
590
592 PoisoningVH<T> Res;
593 Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
594 return Res;
595 }
596
597 static unsigned getHashValue(const PoisoningVH<T> &Val) {
598 return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
599 }
600
601 static bool isEqual(const PoisoningVH<T> &LHS, const PoisoningVH<T> &RHS) {
602 return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
603 RHS.getRawValPtr());
604 }
605
606 // Allow lookup by T* via find_as(), without constructing a temporary
607 // value handle.
608
609 static unsigned getHashValue(const T *Val) {
611 }
612
613 static bool isEqual(const T *LHS, const PoisoningVH<T> &RHS) {
614 return DenseMapInfo<Value *>::isEqual(LHS, RHS.getRawValPtr());
615 }
616};
617
618} // end namespace llvm
619
620#endif // LLVM_IR_VALUEHANDLE_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
aarch64 promote const
#define LLVM_ABI
Definition Compiler.h:213
This file defines DenseMapInfo traits for DenseMap.
#define T
#define P(N)
if(PassOpts->AAPipeline)
This file defines the PointerIntPair class.
static bool isValid(const char C)
Returns true if C is a valid mangled character: <0-9a-zA-Z_>.
Value * RHS
Value * LHS
Value handle that asserts if the Value is deleted.
ValueTy * operator=(ValueTy *RHS)
ValueTy & operator*() const
ValueTy * operator=(const AssertingVH< ValueTy > &RHS)
ValueTy * operator->() const
AssertingVH(ValueTy *P)
AssertingVH(const AssertingVH &)=default
ValueTy * operator=(AssertingVH< ValueTy > &&RHS)
AssertingVH(AssertingVH &&RHS)
Value handle with callbacks on RAUW and destruction.
virtual void allUsesReplacedWith(Value *)
Callback for Value RAUW.
CallbackVH(const Value *P)
CallbackVH & operator=(const CallbackVH &)=default
CallbackVH(Value *P)
CallbackVH(const CallbackVH &)=default
virtual void deleted()
Callback for Value destruction.
void setValPtr(Value *P)
~CallbackVH()=default
PointerIntPair - This class implements a pair of a pointer and small integer.
IntType getInt() const
PointerTy getPointer() const
Value handle that poisons itself if the Value is deleted.
ValueTy & operator*() const
PoisoningVH()=default
ValueTy * operator->() const
PoisoningVH(ValueTy *P)
ValueTy * operator->() const
ValueTy * getValPtr() const
static Value * GetAsValue(const Value *V)
static Value * GetAsValue(Value *V)
ValueTy & operator*() const
void setValPtr(ValueTy *P)
ValueTy * operator=(ValueTy *RHS)
TrackingVH(ValueTy *P)
TrackingVH()=default
This is the common base class of value handles.
Definition ValueHandle.h:30
Value & operator*() const
ValueHandleBase(HandleBaseKind Kind, Value *V)
Definition ValueHandle.h:69
static bool isValid(Value *V)
LLVM_ABI void RemoveFromUseList()
Remove this ValueHandle from its current use list.
Definition Value.cpp:1204
ValueHandleBase(HandleBaseKind Kind, ValueHandleBase &&RHS)
Definition ValueHandle.h:50
Value * operator->() const
Value * operator=(Value *RHS)
Definition ValueHandle.h:80
Value * operator=(const ValueHandleBase &RHS)
Definition ValueHandle.h:91
Value * getValPtr() const
Value * operator=(ValueHandleBase &&RHS)
static LLVM_ABI void ValueIsDeleted(Value *V)
Definition Value.cpp:1233
void clearValPtr()
Clear the underlying pointer without clearing the use list.
friend class PoisoningVH
Definition ValueHandle.h:32
ValueHandleBase(HandleBaseKind Kind)
Definition ValueHandle.h:67
static LLVM_ABI void ValueIsRAUWd(Value *Old, Value *New)
Definition Value.cpp:1286
HandleBaseKind
This indicates what sub class the handle actually is.
Definition ValueHandle.h:39
ValueHandleBase(HandleBaseKind Kind, const ValueHandleBase &RHS)
Definition ValueHandle.h:44
ValueHandleBase(const ValueHandleBase &RHS)
Definition ValueHandle.h:41
LLVM Value Representation.
Definition Value.h:75
Value handle that is nullable, but tries to track the Value.
WeakTrackingVH(const WeakTrackingVH &RHS)
Value * operator=(const ValueHandleBase &RHS)
Value * operator=(Value *RHS)
WeakTrackingVH & operator=(const WeakTrackingVH &RHS)=default
bool pointsToAliveValue() const
A nullable Value handle that is nullable.
WeakVH(Value *P)
WeakVH(const WeakVH &RHS)
WeakVH & operator=(const WeakVH &RHS)=default
Value * operator=(const ValueHandleBase &RHS)
Value * operator=(Value *RHS)
This is an optimization pass for GlobalISel generic memory operations.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
FunctionAddr VTableAddr Next
Definition InstrProf.h:141
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:874
static bool isEqual(const T *LHS, const PoisoningVH< T > &RHS)
static PoisoningVH< T > getTombstoneKey()
static unsigned getHashValue(const T *Val)
static unsigned getHashValue(const PoisoningVH< T > &Val)
static bool isEqual(const PoisoningVH< T > &LHS, const PoisoningVH< T > &RHS)
static PoisoningVH< T > getEmptyKey()
static bool isEqual(const WeakVH &LHS, const WeakVH &RHS)
static unsigned getHashValue(const WeakVH &Val)
static WeakVH getTombstoneKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
static SimpleType getSimplifiedValue(WeakTrackingVH &WVH)
static SimpleType getSimplifiedValue(WeakVH &WVH)
static SimpleType getSimplifiedValue(const WeakVH &WVH)
Define a template that can be specialized by smart pointers to reflect the fact that they are automat...
Definition Casting.h:34
static SimpleType & getSimplifiedValue(From &Val)
Definition Casting.h:38