LLVM  8.0.1
ValueHandle.h
Go to the documentation of this file.
1 //===- ValueHandle.h - Value Smart Pointer classes --------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the ValueHandle class and its sub-classes.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_IR_VALUEHANDLE_H
15 #define LLVM_IR_VALUEHANDLE_H
16 
17 #include "llvm/ADT/DenseMapInfo.h"
19 #include "llvm/IR/Value.h"
20 #include "llvm/Support/Casting.h"
21 #include <cassert>
22 
23 namespace 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 
33 protected:
34  /// This indicates what sub class the handle actually is.
35  ///
36  /// This is to avoid having a vtable for the light-weight handle pointers. The
37  /// fully general Callback version does have a vtable.
39 
41  : ValueHandleBase(RHS.PrevPair.getInt(), RHS) {}
42 
44  : PrevPair(nullptr, Kind), Val(RHS.getValPtr()) {
45  if (isValid(getValPtr()))
46  AddToExistingUseList(RHS.getPrevPtr());
47  }
48 
49 private:
51  ValueHandleBase *Next = nullptr;
52  Value *Val = nullptr;
53 
54  void setValPtr(Value *V) { Val = V; }
55 
56 public:
58  : PrevPair(nullptr, Kind) {}
60  : PrevPair(nullptr, Kind), Val(V) {
61  if (isValid(getValPtr()))
62  AddToUseList();
63  }
64 
66  if (isValid(getValPtr()))
68  }
69 
71  if (getValPtr() == RHS)
72  return RHS;
73  if (isValid(getValPtr()))
75  setValPtr(RHS);
76  if (isValid(getValPtr()))
77  AddToUseList();
78  return RHS;
79  }
80 
82  if (getValPtr() == RHS.getValPtr())
83  return RHS.getValPtr();
84  if (isValid(getValPtr()))
86  setValPtr(RHS.getValPtr());
87  if (isValid(getValPtr()))
88  AddToExistingUseList(RHS.getPrevPtr());
89  return getValPtr();
90  }
91 
92  Value *operator->() const { return getValPtr(); }
93  Value &operator*() const { return *getValPtr(); }
94 
95 protected:
96  Value *getValPtr() const { return Val; }
97 
98  static bool isValid(Value *V) {
99  return V &&
102  }
103 
104  /// Remove this ValueHandle from its current use list.
105  void RemoveFromUseList();
106 
107  /// Clear the underlying pointer without clearing the use list.
108  ///
109  /// This should only be used if a derived class has manually removed the
110  /// handle from the use list.
111  void clearValPtr() { setValPtr(nullptr); }
112 
113 public:
114  // Callbacks made from Value.
115  static void ValueIsDeleted(Value *V);
116  static void ValueIsRAUWd(Value *Old, Value *New);
117 
118 private:
119  // Internal implementation details.
120  ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
121  HandleBaseKind getKind() const { return PrevPair.getInt(); }
122  void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
123 
124  /// Add this ValueHandle to the use list for V.
125  ///
126  /// List is the address of either the head of the list or a Next node within
127  /// the existing use list.
128  void AddToExistingUseList(ValueHandleBase **List);
129 
130  /// Add this ValueHandle to the use list after Node.
131  void AddToExistingUseListAfter(ValueHandleBase *Node);
132 
133  /// Add this ValueHandle to the use list for V.
134  void AddToUseList();
135 };
136 
137 /// A nullable Value handle that is nullable.
138 ///
139 /// This is a value handle that points to a value, and nulls itself
140 /// out if that value is deleted.
141 class WeakVH : public ValueHandleBase {
142 public:
145  WeakVH(const WeakVH &RHS)
146  : ValueHandleBase(Weak, RHS) {}
147 
148  WeakVH &operator=(const WeakVH &RHS) = default;
149 
151  return ValueHandleBase::operator=(RHS);
152  }
154  return ValueHandleBase::operator=(RHS);
155  }
156 
157  operator Value*() const {
158  return getValPtr();
159  }
160 };
161 
162 // Specialize simplify_type to allow WeakVH to participate in
163 // dyn_cast, isa, etc.
164 template <> struct simplify_type<WeakVH> {
165  using SimpleType = Value *;
166 
167  static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
168 };
169 template <> struct simplify_type<const WeakVH> {
170  using SimpleType = Value *;
171 
172  static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
173 };
174 
175 /// Value handle that is nullable, but tries to track the Value.
176 ///
177 /// This is a value handle that tries hard to point to a Value, even across
178 /// RAUW operations, but will null itself out if the value is destroyed. this
179 /// is useful for advisory sorts of information, but should not be used as the
180 /// key of a map (since the map would have to rearrange itself when the pointer
181 /// changes).
183 public:
187  : ValueHandleBase(WeakTracking, RHS) {}
188 
189  WeakTrackingVH &operator=(const WeakTrackingVH &RHS) = default;
190 
192  return ValueHandleBase::operator=(RHS);
193  }
195  return ValueHandleBase::operator=(RHS);
196  }
197 
198  operator Value*() const {
199  return getValPtr();
200  }
201 
202  bool pointsToAliveValue() const {
204  }
205 };
206 
207 // Specialize simplify_type to allow WeakTrackingVH to participate in
208 // dyn_cast, isa, etc.
209 template <> struct simplify_type<WeakTrackingVH> {
210  using SimpleType = Value *;
211 
212  static SimpleType getSimplifiedValue(WeakTrackingVH &WVH) { return WVH; }
213 };
214 template <> struct simplify_type<const WeakTrackingVH> {
215  using SimpleType = Value *;
216 
218  return WVH;
219  }
220 };
221 
222 /// Value handle that asserts if the Value is deleted.
223 ///
224 /// This is a Value Handle that points to a value and asserts out if the value
225 /// is destroyed while the handle is still live. This is very useful for
226 /// catching dangling pointer bugs and other things which can be non-obvious.
227 /// One particularly useful place to use this is as the Key of a map. Dangling
228 /// pointer bugs often lead to really subtle bugs that only occur if another
229 /// object happens to get allocated to the same address as the old one. Using
230 /// an AssertingVH ensures that an assert is triggered as soon as the bad
231 /// delete occurs.
232 ///
233 /// Note that an AssertingVH handle does *not* follow values across RAUW
234 /// operations. This means that RAUW's need to explicitly update the
235 /// AssertingVH's as it moves. This is required because in non-assert mode this
236 /// class turns into a trivial wrapper around a pointer.
237 template <typename ValueTy>
239 #ifndef NDEBUG
240  : public ValueHandleBase
241 #endif
242  {
243  friend struct DenseMapInfo<AssertingVH<ValueTy>>;
244 
245 #ifndef NDEBUG
246  Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
247  void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
248 #else
249  Value *ThePtr;
250  Value *getRawValPtr() const { return ThePtr; }
251  void setRawValPtr(Value *P) { ThePtr = P; }
252 #endif
253  // Convert a ValueTy*, which may be const, to the raw Value*.
254  static Value *GetAsValue(Value *V) { return V; }
255  static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
256 
257  ValueTy *getValPtr() const { return static_cast<ValueTy *>(getRawValPtr()); }
258  void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
259 
260 public:
261 #ifndef NDEBUG
263  AssertingVH(ValueTy *P) : ValueHandleBase(Assert, GetAsValue(P)) {}
265 #else
266  AssertingVH() : ThePtr(nullptr) {}
267  AssertingVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
268 #endif
269 
270  operator ValueTy*() const {
271  return getValPtr();
272  }
273 
274  ValueTy *operator=(ValueTy *RHS) {
275  setValPtr(RHS);
276  return getValPtr();
277  }
278  ValueTy *operator=(const AssertingVH<ValueTy> &RHS) {
279  setValPtr(RHS.getValPtr());
280  return getValPtr();
281  }
282 
283  ValueTy *operator->() const { return getValPtr(); }
284  ValueTy &operator*() const { return *getValPtr(); }
285 };
286 
287 // Specialize DenseMapInfo to allow AssertingVH to participate in DenseMap.
288 template<typename T>
290  static inline AssertingVH<T> getEmptyKey() {
291  AssertingVH<T> Res;
292  Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
293  return Res;
294  }
295 
296  static inline AssertingVH<T> getTombstoneKey() {
297  AssertingVH<T> Res;
298  Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
299  return Res;
300  }
301 
302  static unsigned getHashValue(const AssertingVH<T> &Val) {
303  return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
304  }
305 
306  static bool isEqual(const AssertingVH<T> &LHS, const AssertingVH<T> &RHS) {
307  return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
308  RHS.getRawValPtr());
309  }
310 };
311 
312 template <typename T>
314 #ifdef NDEBUG
315  static const bool value = true;
316 #else
317  static const bool value = false;
318 #endif
319 };
320 
321 /// Value handle that tracks a Value across RAUW.
322 ///
323 /// TrackingVH is designed for situations where a client needs to hold a handle
324 /// to a Value (or subclass) across some operations which may move that value,
325 /// but should never destroy it or replace it with some unacceptable type.
326 ///
327 /// It is an error to attempt to replace a value with one of a type which is
328 /// incompatible with any of its outstanding TrackingVHs.
329 ///
330 /// It is an error to read from a TrackingVH that does not point to a valid
331 /// value. A TrackingVH is said to not point to a valid value if either it
332 /// hasn't yet been assigned a value yet or because the value it was tracking
333 /// has since been deleted.
334 ///
335 /// Assigning a value to a TrackingVH is always allowed, even if said TrackingVH
336 /// no longer points to a valid value.
337 template <typename ValueTy> class TrackingVH {
338  WeakTrackingVH InnerHandle;
339 
340 public:
341  ValueTy *getValPtr() const {
342  assert(InnerHandle.pointsToAliveValue() &&
343  "TrackingVH must be non-null and valid on dereference!");
344 
345  // Check that the value is a member of the correct subclass. We would like
346  // to check this property on assignment for better debugging, but we don't
347  // want to require a virtual interface on this VH. Instead we allow RAUW to
348  // replace this value with a value of an invalid type, and check it here.
349  assert(isa<ValueTy>(InnerHandle) &&
350  "Tracked Value was replaced by one with an invalid type!");
351  return cast<ValueTy>(InnerHandle);
352  }
353 
354  void setValPtr(ValueTy *P) {
355  // Assigning to non-valid TrackingVH's are fine so we just unconditionally
356  // assign here.
357  InnerHandle = GetAsValue(P);
358  }
359 
360  // Convert a ValueTy*, which may be const, to the type the base
361  // class expects.
362  static Value *GetAsValue(Value *V) { return V; }
363  static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
364 
365 public:
366  TrackingVH() = default;
367  TrackingVH(ValueTy *P) { setValPtr(P); }
368 
369  operator ValueTy*() const {
370  return getValPtr();
371  }
372 
373  ValueTy *operator=(ValueTy *RHS) {
374  setValPtr(RHS);
375  return getValPtr();
376  }
377 
378  ValueTy *operator->() const { return getValPtr(); }
379  ValueTy &operator*() const { return *getValPtr(); }
380 };
381 
382 /// Value handle with callbacks on RAUW and destruction.
383 ///
384 /// This is a value handle that allows subclasses to define callbacks that run
385 /// when the underlying Value has RAUW called on it or is destroyed. This
386 /// class can be used as the key of a map, as long as the user takes it out of
387 /// the map before calling setValPtr() (since the map has to rearrange itself
388 /// when the pointer changes). Unlike ValueHandleBase, this class has a vtable.
389 class CallbackVH : public ValueHandleBase {
390  virtual void anchor();
391 protected:
392  ~CallbackVH() = default;
393  CallbackVH(const CallbackVH &) = default;
394  CallbackVH &operator=(const CallbackVH &) = default;
395 
396  void setValPtr(Value *P) {
398  }
399 
400 public:
403 
404  operator Value*() const {
405  return getValPtr();
406  }
407 
408  /// Callback for Value destruction.
409  ///
410  /// Called when this->getValPtr() is destroyed, inside ~Value(), so you
411  /// may call any non-virtual Value method on getValPtr(), but no subclass
412  /// methods. If WeakTrackingVH were implemented as a CallbackVH, it would use
413  /// this
414  /// method to call setValPtr(NULL). AssertingVH would use this method to
415  /// cause an assertion failure.
416  ///
417  /// All implementations must remove the reference from this object to the
418  /// Value that's being destroyed.
419  virtual void deleted() { setValPtr(nullptr); }
420 
421  /// Callback for Value RAUW.
422  ///
423  /// Called when this->getValPtr()->replaceAllUsesWith(new_value) is called,
424  /// _before_ any of the uses have actually been replaced. If WeakTrackingVH
425  /// were
426  /// implemented as a CallbackVH, it would use this method to call
427  /// setValPtr(new_value). AssertingVH would do nothing in this method.
428  virtual void allUsesReplacedWith(Value *) {}
429 };
430 
431 /// Value handle that poisons itself if the Value is deleted.
432 ///
433 /// This is a Value Handle that points to a value and poisons itself if the
434 /// value is destroyed while the handle is still live. This is very useful for
435 /// catching dangling pointer bugs where an \c AssertingVH cannot be used
436 /// because the dangling handle needs to outlive the value without ever being
437 /// used.
438 ///
439 /// One particularly useful place to use this is as the Key of a map. Dangling
440 /// pointer bugs often lead to really subtle bugs that only occur if another
441 /// object happens to get allocated to the same address as the old one. Using
442 /// a PoisoningVH ensures that an assert is triggered if looking up a new value
443 /// in the map finds a handle from the old value.
444 ///
445 /// Note that a PoisoningVH handle does *not* follow values across RAUW
446 /// operations. This means that RAUW's need to explicitly update the
447 /// PoisoningVH's as it moves. This is required because in non-assert mode this
448 /// class turns into a trivial wrapper around a pointer.
449 template <typename ValueTy>
451 #ifndef NDEBUG
452  final : public CallbackVH
453 #endif
454 {
455  friend struct DenseMapInfo<PoisoningVH<ValueTy>>;
456 
457  // Convert a ValueTy*, which may be const, to the raw Value*.
458  static Value *GetAsValue(Value *V) { return V; }
459  static Value *GetAsValue(const Value *V) { return const_cast<Value *>(V); }
460 
461 #ifndef NDEBUG
462  /// A flag tracking whether this value has been poisoned.
463  ///
464  /// On delete and RAUW, we leave the value pointer alone so that as a raw
465  /// pointer it produces the same value (and we fit into the same key of
466  /// a hash table, etc), but we poison the handle so that any top-level usage
467  /// will fail.
468  bool Poisoned = false;
469 
470  Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
471  void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
472 
473  /// Handle deletion by poisoning the handle.
474  void deleted() override {
475  assert(!Poisoned && "Tried to delete an already poisoned handle!");
476  Poisoned = true;
478  }
479 
480  /// Handle RAUW by poisoning the handle.
481  void allUsesReplacedWith(Value *) override {
482  assert(!Poisoned && "Tried to RAUW an already poisoned handle!");
483  Poisoned = true;
485  }
486 #else // NDEBUG
487  Value *ThePtr = nullptr;
488 
489  Value *getRawValPtr() const { return ThePtr; }
490  void setRawValPtr(Value *P) { ThePtr = P; }
491 #endif
492 
493  ValueTy *getValPtr() const {
494  assert(!Poisoned && "Accessed a poisoned value handle!");
495  return static_cast<ValueTy *>(getRawValPtr());
496  }
497  void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
498 
499 public:
500  PoisoningVH() = default;
501 #ifndef NDEBUG
502  PoisoningVH(ValueTy *P) : CallbackVH(GetAsValue(P)) {}
504  : CallbackVH(RHS), Poisoned(RHS.Poisoned) {}
505 
507  if (Poisoned)
508  clearValPtr();
509  }
510 
512  if (Poisoned)
513  clearValPtr();
515  Poisoned = RHS.Poisoned;
516  return *this;
517  }
518 #else
519  PoisoningVH(ValueTy *P) : ThePtr(GetAsValue(P)) {}
520 #endif
521 
522  operator ValueTy *() const { return getValPtr(); }
523 
524  ValueTy *operator->() const { return getValPtr(); }
525  ValueTy &operator*() const { return *getValPtr(); }
526 };
527 
528 // Specialize DenseMapInfo to allow PoisoningVH to participate in DenseMap.
529 template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
530  static inline PoisoningVH<T> getEmptyKey() {
531  PoisoningVH<T> Res;
532  Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
533  return Res;
534  }
535 
536  static inline PoisoningVH<T> getTombstoneKey() {
537  PoisoningVH<T> Res;
538  Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
539  return Res;
540  }
541 
542  static unsigned getHashValue(const PoisoningVH<T> &Val) {
543  return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
544  }
545 
546  static bool isEqual(const PoisoningVH<T> &LHS, const PoisoningVH<T> &RHS) {
547  return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
548  RHS.getRawValPtr());
549  }
550 };
551 
552 template <typename T> struct isPodLike<PoisoningVH<T>> {
553 #ifdef NDEBUG
554  static const bool value = true;
555 #else
556  static const bool value = false;
557 #endif
558 };
559 
560 } // end namespace llvm
561 
562 #endif // LLVM_IR_VALUEHANDLE_H
This is the common base class of value handles.
Definition: ValueHandle.h:30
static void ValueIsDeleted(Value *V)
Definition: Value.cpp:832
PoisoningVH & operator=(const PoisoningVH &RHS)
Definition: ValueHandle.h:511
static PoisoningVH< T > getEmptyKey()
Definition: ValueHandle.h:530
PoisoningVH(ValueTy *P)
Definition: ValueHandle.h:502
This class represents lattice values for constants.
Definition: AllocatorList.h:24
PointerTy getPointer() const
ValueHandleBase(HandleBaseKind Kind, const ValueHandleBase &RHS)
Definition: ValueHandle.h:43
ValueTy * operator=(const AssertingVH< ValueTy > &RHS)
Definition: ValueHandle.h:278
Value * operator=(Value *RHS)
Definition: ValueHandle.h:150
CallbackVH & operator=(const CallbackVH &)=default
WeakVH(Value *P)
Definition: ValueHandle.h:144
WeakTrackingVH(Value *P)
Definition: ValueHandle.h:185
ValueHandleBase(HandleBaseKind Kind)
Definition: ValueHandle.h:57
ValueTy & operator*() const
Definition: ValueHandle.h:379
static SimpleType getSimplifiedValue(const WeakTrackingVH &WVH)
Definition: ValueHandle.h:217
WeakTrackingVH(const WeakTrackingVH &RHS)
Definition: ValueHandle.h:186
void setValPtr(Value *P)
Definition: ValueHandle.h:396
void setPointer(PointerTy PtrVal)
static PoisoningVH< T > getTombstoneKey()
Definition: ValueHandle.h:536
PoisoningVH(const PoisoningVH &RHS)
Definition: ValueHandle.h:503
static unsigned getInt(StringRef R)
Get an unsigned integer, including error checks.
Definition: DataLayout.cpp:213
Value * operator=(const ValueHandleBase &RHS)
Definition: ValueHandle.h:153
ValueTy * operator->() const
Definition: ValueHandle.h:524
virtual void allUsesReplacedWith(Value *)
Callback for Value RAUW.
Definition: ValueHandle.h:428
Value handle that is nullable, but tries to track the Value.
Definition: ValueHandle.h:182
TrackingVH(ValueTy *P)
Definition: ValueHandle.h:367
static bool isEqual(const Function &Caller, const Function &Callee)
static Value * GetAsValue(const Value *V)
Definition: ValueHandle.h:363
IntType getInt() const
A nullable Value handle that is nullable.
Definition: ValueHandle.h:141
ValueTy * operator->() const
Definition: ValueHandle.h:378
static SimpleType getSimplifiedValue(WeakTrackingVH &WVH)
Definition: ValueHandle.h:212
ValueTy & operator*() const
Definition: ValueHandle.h:284
static Value * GetAsValue(Value *V)
Definition: ValueHandle.h:362
static void ValueIsRAUWd(Value *Old, Value *New)
Definition: Value.cpp:885
static SimpleType getSimplifiedValue(const WeakVH &WVH)
Definition: ValueHandle.h:172
Value * operator=(const ValueHandleBase &RHS)
Definition: ValueHandle.h:194
bool pointsToAliveValue() const
Definition: ValueHandle.h:202
Value handle that poisons itself if the Value is deleted.
Definition: ValueHandle.h:450
#define P(N)
void RemoveFromUseList()
Remove this ValueHandle from its current use list.
Definition: Value.cpp:806
PointerIntPair - This class implements a pair of a pointer and small integer.
static bool isValid(Value *V)
Definition: ValueHandle.h:98
Value handle that tracks a Value across RAUW.
Definition: ValueHandle.h:337
ValueHandleBase(const ValueHandleBase &RHS)
Definition: ValueHandle.h:40
void setValPtr(ValueTy *P)
Definition: ValueHandle.h:354
Value & operator*() const
Definition: ValueHandle.h:93
ValueHandleBase(HandleBaseKind Kind, Value *V)
Definition: ValueHandle.h:59
ValueTy & operator*() const
Definition: ValueHandle.h:525
Value * operator=(const ValueHandleBase &RHS)
Definition: ValueHandle.h:81
static SimpleType getSimplifiedValue(WeakVH &WVH)
Definition: ValueHandle.h:167
Value * operator->() const
Definition: ValueHandle.h:92
virtual void deleted()
Callback for Value destruction.
Definition: ValueHandle.h:419
static bool isEqual(const AssertingVH< T > &LHS, const AssertingVH< T > &RHS)
Definition: ValueHandle.h:306
CallbackVH(Value *P)
Definition: ValueHandle.h:402
void clearValPtr()
Clear the underlying pointer without clearing the use list.
Definition: ValueHandle.h:111
static bool isEqual(const PoisoningVH< T > &LHS, const PoisoningVH< T > &RHS)
Definition: ValueHandle.h:546
AssertingVH(const AssertingVH &RHS)
Definition: ValueHandle.h:264
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
Definition: ArrayRef.h:530
static unsigned getHashValue(const PoisoningVH< T > &Val)
Definition: ValueHandle.h:542
ValueTy * operator=(ValueTy *RHS)
Definition: ValueHandle.h:274
Value handle that asserts if the Value is deleted.
Definition: ValueHandle.h:238
#define NDEBUG
Definition: regutils.h:48
Value * operator=(Value *RHS)
Definition: ValueHandle.h:191
const NodeList & List
Definition: RDFGraph.cpp:210
ValueTy * operator->() const
Definition: ValueHandle.h:283
static unsigned getHashValue(const AssertingVH< T > &Val)
Definition: ValueHandle.h:302
Value * operator=(Value *RHS)
Definition: ValueHandle.h:70
WeakVH(const WeakVH &RHS)
Definition: ValueHandle.h:145
static AssertingVH< T > getEmptyKey()
Definition: ValueHandle.h:290
ValueTy * operator=(ValueTy *RHS)
Definition: ValueHandle.h:373
const unsigned Kind
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
HandleBaseKind
This indicates what sub class the handle actually is.
Definition: ValueHandle.h:38
aarch64 promote const
LLVM Value Representation.
Definition: Value.h:73
AssertingVH(ValueTy *P)
Definition: ValueHandle.h:263
static AssertingVH< T > getTombstoneKey()
Definition: ValueHandle.h:296
Value handle with callbacks on RAUW and destruction.
Definition: ValueHandle.h:389
ValueTy * getValPtr() const
Definition: ValueHandle.h:341
Value * getValPtr() const
Definition: ValueHandle.h:96