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 && V != DenseMapInfo<Value *>::getEmptyKey();
134 }
135
136 /// Remove this ValueHandle from its current use list.
138
139 /// Clear the underlying pointer without clearing the use list.
140 ///
141 /// This should only be used if a derived class has manually removed the
142 /// handle from the use list.
143 void clearValPtr() { setValPtr(nullptr); }
144
145public:
146 // Callbacks made from Value.
147 LLVM_ABI static void ValueIsDeleted(Value *V);
148 LLVM_ABI static void ValueIsRAUWd(Value *Old, Value *New);
149
150private:
151 // Internal implementation details.
152 ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
153 HandleBaseKind getKind() const { return PrevPair.getInt(); }
154 void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
155
156 /// Add this ValueHandle to the use list for V.
157 ///
158 /// List is the address of either the head of the list or a Next node within
159 /// the existing use list.
160 LLVM_ABI void AddToExistingUseList(ValueHandleBase **List);
161
162 /// Add this ValueHandle to the use list after Node.
163 void AddToExistingUseListAfter(ValueHandleBase *Node);
164
165 /// Add this ValueHandle to the use list for V.
166 LLVM_ABI void AddToUseList();
167};
168
169/// A nullable Value handle that is nullable.
170///
171/// This is a value handle that points to a value, and nulls itself
172/// out if that value is deleted.
173class WeakVH : public ValueHandleBase {
174public:
179
180 WeakVH &operator=(const WeakVH &RHS) = default;
181
188
189 operator Value*() const {
190 return getValPtr();
191 }
192};
193
194// Specialize simplify_type to allow WeakVH to participate in
195// dyn_cast, isa, etc.
196template <> struct simplify_type<WeakVH> {
197 using SimpleType = Value *;
198
199 static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
200};
201template <> struct simplify_type<const WeakVH> {
202 using SimpleType = Value *;
203
204 static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
205};
206
207// Specialize DenseMapInfo to allow WeakVH to participate in DenseMap.
208template <> struct DenseMapInfo<WeakVH> {
209 static inline WeakVH getEmptyKey() {
211 }
212
213 static unsigned getHashValue(const WeakVH &Val) {
215 }
216
217 static bool isEqual(const WeakVH &LHS, const WeakVH &RHS) {
219 }
220};
221
222/// Value handle that is nullable, but tries to track the Value.
223///
224/// This is a value handle that tries hard to point to a Value, even across
225/// RAUW operations, but will null itself out if the value is destroyed. this
226/// is useful for advisory sorts of information, but should not be used as the
227/// key of a map (since the map would have to rearrange itself when the pointer
228/// changes).
253
254// Specialize simplify_type to allow WeakTrackingVH to participate in
255// dyn_cast, isa, etc.
256template <> struct simplify_type<WeakTrackingVH> {
257 using SimpleType = Value *;
258
259 static SimpleType getSimplifiedValue(WeakTrackingVH &WVH) { return WVH; }
260};
261template <> struct simplify_type<const WeakTrackingVH> {
262 using SimpleType = Value *;
263
265 return WVH;
266 }
267};
268
269/// Value handle that asserts if the Value is deleted.
270///
271/// This is a Value Handle that points to a value and asserts out if the value
272/// is destroyed while the handle is still live. This is very useful for
273/// catching dangling pointer bugs and other things which can be non-obvious.
274/// One particularly useful place to use this is as the Key of a map. Dangling
275/// pointer bugs often lead to really subtle bugs that only occur if another
276/// object happens to get allocated to the same address as the old one. Using
277/// an AssertingVH ensures that an assert is triggered as soon as the bad
278/// delete occurs.
279///
280/// Note that an AssertingVH handle does *not* follow values across RAUW
281/// operations. This means that RAUW's need to explicitly update the
282/// AssertingVH's as it moves. This is required because in non-assert mode this
283/// class turns into a trivial wrapper around a pointer.
284template <typename ValueTy>
286#if LLVM_ENABLE_ABI_BREAKING_CHECKS
287 : public ValueHandleBase
288#endif
289{
290 friend struct DenseMapInfo<AssertingVH<ValueTy>>;
291
292#if LLVM_ENABLE_ABI_BREAKING_CHECKS
293 Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
294 void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
295#else
296 Value *ThePtr;
297 Value *getRawValPtr() const { return ThePtr; }
298 void setRawValPtr(Value *P) { ThePtr = P; }
299#endif
300 // Convert a ValueTy*, which may be const, to the raw Value*.
301 static Value *GetAsValue(Value *V) { return V; }
302 static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
303
304 ValueTy *getValPtr() const { return static_cast<ValueTy *>(getRawValPtr()); }
305 void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
306
307public:
308#if LLVM_ENABLE_ABI_BREAKING_CHECKS
309 AssertingVH() : ValueHandleBase(Assert) {}
310 AssertingVH(ValueTy *P) : ValueHandleBase(Assert, GetAsValue(P)) {}
311 AssertingVH(const AssertingVH &RHS) : ValueHandleBase(Assert, RHS) {}
312 AssertingVH(AssertingVH &&RHS) : ValueHandleBase(Assert, std::move(RHS)) {}
313#else
314 AssertingVH() : ThePtr(nullptr) {}
315 AssertingVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
316 AssertingVH(const AssertingVH &) = default;
317 AssertingVH(AssertingVH &&RHS) : ThePtr(std::exchange(RHS.ThePtr, nullptr)) {}
318#endif
319
320 operator ValueTy*() const {
321 return getValPtr();
322 }
323
324 ValueTy *operator=(ValueTy *RHS) {
325 setValPtr(RHS);
326 return getValPtr();
327 }
329 setValPtr(RHS.getValPtr());
330 return getValPtr();
331 }
332#if LLVM_ENABLE_ABI_BREAKING_CHECKS
335 return getValPtr();
336 }
337#else
339 ThePtr = std::exchange(RHS.ThePtr, nullptr);
340 return getValPtr();
341 }
342#endif
343
344 ValueTy *operator->() const { return getValPtr(); }
345 ValueTy &operator*() const { return *getValPtr(); }
346};
347
348// Treat AssertingVH<T> like T* inside maps. This also allows using find_as()
349// to look up a value without constructing a value handle.
350template<typename T>
352
353/// Value handle that tracks a Value across RAUW.
354///
355/// TrackingVH is designed for situations where a client needs to hold a handle
356/// to a Value (or subclass) across some operations which may move that value,
357/// but should never destroy it or replace it with some unacceptable type.
358///
359/// It is an error to attempt to replace a value with one of a type which is
360/// incompatible with any of its outstanding TrackingVHs.
361///
362/// It is an error to read from a TrackingVH that does not point to a valid
363/// value. A TrackingVH is said to not point to a valid value if either it
364/// hasn't yet been assigned a value yet or because the value it was tracking
365/// has since been deleted.
366///
367/// Assigning a value to a TrackingVH is always allowed, even if said TrackingVH
368/// no longer points to a valid value.
369template <typename ValueTy> class TrackingVH {
370 WeakTrackingVH InnerHandle;
371
372public:
373 ValueTy *getValPtr() const {
374 assert(InnerHandle.pointsToAliveValue() &&
375 "TrackingVH must be non-null and valid on dereference!");
376
377 // Check that the value is a member of the correct subclass. We would like
378 // to check this property on assignment for better debugging, but we don't
379 // want to require a virtual interface on this VH. Instead we allow RAUW to
380 // replace this value with a value of an invalid type, and check it here.
381 assert(isa<ValueTy>(InnerHandle) &&
382 "Tracked Value was replaced by one with an invalid type!");
383 return cast<ValueTy>(InnerHandle);
384 }
385
386 void setValPtr(ValueTy *P) {
387 // Assigning to non-valid TrackingVH's are fine so we just unconditionally
388 // assign here.
389 InnerHandle = GetAsValue(P);
390 }
391
392 // Convert a ValueTy*, which may be const, to the type the base
393 // class expects.
394 static Value *GetAsValue(Value *V) { return V; }
395 static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
396
397public:
398 TrackingVH() = default;
399 TrackingVH(ValueTy *P) { setValPtr(P); }
400
401 operator ValueTy*() const {
402 return getValPtr();
403 }
404
405 ValueTy *operator=(ValueTy *RHS) {
406 setValPtr(RHS);
407 return getValPtr();
408 }
409
410 ValueTy *operator->() const { return getValPtr(); }
411 ValueTy &operator*() const { return *getValPtr(); }
412};
413
414/// Value handle with callbacks on RAUW and destruction.
415///
416/// This is a value handle that allows subclasses to define callbacks that run
417/// when the underlying Value has RAUW called on it or is destroyed. This
418/// class can be used as the key of a map, as long as the user takes it out of
419/// the map before calling setValPtr() (since the map has to rearrange itself
420/// when the pointer changes). Unlike ValueHandleBase, this class has a vtable.
422 virtual void anchor();
423protected:
424 ~CallbackVH() = default;
425 CallbackVH(const CallbackVH &) = default;
426 CallbackVH &operator=(const CallbackVH &) = default;
427
431
432public:
435 CallbackVH(const Value *P) : CallbackVH(const_cast<Value *>(P)) {}
436
437 operator Value*() const {
438 return getValPtr();
439 }
440
441 /// Callback for Value destruction.
442 ///
443 /// Called when this->getValPtr() is destroyed, inside ~Value(), so you
444 /// may call any non-virtual Value method on getValPtr(), but no subclass
445 /// methods. If WeakTrackingVH were implemented as a CallbackVH, it would use
446 /// this
447 /// method to call setValPtr(NULL). AssertingVH would use this method to
448 /// cause an assertion failure.
449 ///
450 /// All implementations must remove the reference from this object to the
451 /// Value that's being destroyed.
452 virtual void deleted() { setValPtr(nullptr); }
453
454 /// Callback for Value RAUW.
455 ///
456 /// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
457 /// _before_ any of the uses have actually been replaced. If WeakTrackingVH
458 /// were
459 /// implemented as a CallbackVH, it would use this method to call
460 /// setValPtr(new_value). AssertingVH would do nothing in this method.
461 virtual void allUsesReplacedWith(Value *) {}
462};
463
464/// Value handle that poisons itself if the Value is deleted.
465///
466/// This is a Value Handle that points to a value and poisons itself if the
467/// value is destroyed while the handle is still live. This is very useful for
468/// catching dangling pointer bugs where an \c AssertingVH cannot be used
469/// because the dangling handle needs to outlive the value without ever being
470/// used.
471///
472/// One particularly useful place to use this is as the Key of a map. Dangling
473/// pointer bugs often lead to really subtle bugs that only occur if another
474/// object happens to get allocated to the same address as the old one. Using
475/// a PoisoningVH ensures that an assert is triggered if looking up a new value
476/// in the map finds a handle from the old value.
477///
478/// Note that a PoisoningVH handle does *not* follow values across RAUW
479/// operations. This means that RAUW's need to explicitly update the
480/// PoisoningVH's as it moves. This is required because in non-assert mode this
481/// class turns into a trivial wrapper around a pointer.
482template <typename ValueTy>
483class PoisoningVH final
484#if LLVM_ENABLE_ABI_BREAKING_CHECKS
485 : public CallbackVH
486#endif
487{
488 friend struct DenseMapInfo<PoisoningVH<ValueTy>>;
489
490 // Convert a ValueTy*, which may be const, to the raw Value*.
491 static Value *GetAsValue(Value *V) { return V; }
492 static Value *GetAsValue(const Value *V) { return const_cast<Value *>(V); }
493
494#if LLVM_ENABLE_ABI_BREAKING_CHECKS
495 /// A flag tracking whether this value has been poisoned.
496 ///
497 /// On delete and RAUW, we leave the value pointer alone so that as a raw
498 /// pointer it produces the same value (and we fit into the same key of
499 /// a hash table, etc), but we poison the handle so that any top-level usage
500 /// will fail.
501 bool Poisoned = false;
502
503 Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
504 void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
505
506 /// Handle deletion by poisoning the handle.
507 void deleted() override {
508 assert(!Poisoned && "Tried to delete an already poisoned handle!");
509 Poisoned = true;
510 RemoveFromUseList();
511 }
512
513 /// Handle RAUW by poisoning the handle.
514 void allUsesReplacedWith(Value *) override {
515 assert(!Poisoned && "Tried to RAUW an already poisoned handle!");
516 Poisoned = true;
517 RemoveFromUseList();
518 }
519#else // LLVM_ENABLE_ABI_BREAKING_CHECKS
520 Value *ThePtr = nullptr;
521
522 Value *getRawValPtr() const { return ThePtr; }
523 void setRawValPtr(Value *P) { ThePtr = P; }
524#endif
525
526 ValueTy *getValPtr() const {
527#if LLVM_ENABLE_ABI_BREAKING_CHECKS
528 assert(!Poisoned && "Accessed a poisoned value handle!");
529#endif
530 return static_cast<ValueTy *>(getRawValPtr());
531 }
532 void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
533
534public:
535 PoisoningVH() = default;
536#if LLVM_ENABLE_ABI_BREAKING_CHECKS
537 PoisoningVH(ValueTy *P) : CallbackVH(GetAsValue(P)) {}
538 // A poisoned handle is detached from its use list but keeps its raw value
539 // pointer, so its use-list pointers are stale; a copy must not relink through
540 // them.
541 PoisoningVH(const PoisoningVH &RHS) : CallbackVH(), Poisoned(RHS.Poisoned) {
542 if (Poisoned)
543 ValueHandleBase::setValPtr(RHS.getRawValPtr());
544 else
545 setRawValPtr(RHS.getRawValPtr());
546 }
547
548 ~PoisoningVH() {
549 if (Poisoned)
550 clearValPtr();
551 }
552
553 PoisoningVH &operator=(const PoisoningVH &RHS) {
554 if (Poisoned)
555 clearValPtr();
556 if (RHS.Poisoned) {
557 // Detach *this and copy only the raw pointer; see the copy constructor.
558 if (isValid(getRawValPtr()))
559 RemoveFromUseList();
560 ValueHandleBase::setValPtr(RHS.getRawValPtr());
561 } else {
563 }
564 Poisoned = RHS.Poisoned;
565 return *this;
566 }
567#else
568 PoisoningVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
569#endif
570
571 operator ValueTy *() const { return getValPtr(); }
572
573 ValueTy *operator->() const { return getValPtr(); }
574 ValueTy &operator*() const { return *getValPtr(); }
575};
576
577// Specialize DenseMapInfo to allow PoisoningVH to participate in DenseMap.
578template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
579 static inline PoisoningVH<T> getEmptyKey() {
580 PoisoningVH<T> Res;
581 Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
582 return Res;
583 }
584
585 static unsigned getHashValue(const PoisoningVH<T> &Val) {
586 return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
587 }
588
589 static bool isEqual(const PoisoningVH<T> &LHS, const PoisoningVH<T> &RHS) {
590 return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
591 RHS.getRawValPtr());
592 }
593
594 // Allow lookup by T* via find_as(), without constructing a temporary
595 // value handle.
596
597 static unsigned getHashValue(const T *Val) {
599 }
600
601 static bool isEqual(const T *LHS, const PoisoningVH<T> &RHS) {
602 return DenseMapInfo<Value *>::isEqual(LHS, RHS.getRawValPtr());
603 }
604};
605
606} // end namespace llvm
607
608#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:1213
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:1242
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:1295
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:861
static bool isEqual(const T *LHS, const PoisoningVH< T > &RHS)
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)
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