|
LLVM 23.0.0git
|
Value handle that asserts if the Value is deleted. More...
#include "llvm/IR/ValueHandle.h"
Public Member Functions | |
| AssertingVH () | |
| AssertingVH (ValueTy *P) | |
| AssertingVH (const AssertingVH &)=default | |
| AssertingVH (AssertingVH &&RHS) | |
| operator ValueTy * () const | |
| ValueTy * | operator= (ValueTy *RHS) |
| ValueTy * | operator= (const AssertingVH< ValueTy > &RHS) |
| ValueTy * | operator= (AssertingVH< ValueTy > &&RHS) |
| ValueTy * | operator-> () const |
| ValueTy & | operator* () const |
Friends | |
| struct | DenseMapInfo< AssertingVH< ValueTy > > |
Value handle that asserts if the Value is deleted.
This is a Value Handle that points to a value and asserts out if the value is destroyed while the handle is still live. This is very useful for catching dangling pointer bugs and other things which can be non-obvious. One particularly useful place to use this is as the Key of a map. Dangling pointer bugs often lead to really subtle bugs that only occur if another object happens to get allocated to the same address as the old one. Using an AssertingVH ensures that an assert is triggered as soon as the bad delete occurs.
Note that an AssertingVH handle does not follow values across RAUW operations. This means that RAUW's need to explicitly update the AssertingVH's as it moves. This is required because in non-assert mode this class turns into a trivial wrapper around a pointer.
Definition at line 279 of file ValueHandle.h.
|
inline |
Definition at line 308 of file ValueHandle.h.
Referenced by AssertingVH(), AssertingVH(), operator=(), and operator=().
|
inline |
Definition at line 309 of file ValueHandle.h.
References P.
|
default |
References AssertingVH().
|
inline |
Definition at line 311 of file ValueHandle.h.
References AssertingVH(), and RHS.
|
inline |
Definition at line 314 of file ValueHandle.h.
|
inline |
Definition at line 339 of file ValueHandle.h.
|
inline |
Definition at line 338 of file ValueHandle.h.
|
inline |
Definition at line 332 of file ValueHandle.h.
References AssertingVH(), and RHS.
|
inline |
Definition at line 322 of file ValueHandle.h.
References AssertingVH(), and RHS.
|
inline |
Definition at line 318 of file ValueHandle.h.
References RHS.
|
friend |
Definition at line 258 of file ValueHandle.h.