LLVM
8.0.1
|
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 &RHS) | |
operator ValueTy * () const | |
ValueTy * | operator= (ValueTy *RHS) |
ValueTy * | operator= (const AssertingVH< ValueTy > &RHS) |
ValueTy * | operator-> () const |
ValueTy & | operator* () const |
Public Member Functions inherited from llvm::ValueHandleBase | |
ValueHandleBase (HandleBaseKind Kind) | |
ValueHandleBase (HandleBaseKind Kind, Value *V) | |
~ValueHandleBase () | |
Value * | operator= (Value *RHS) |
Value * | operator= (const ValueHandleBase &RHS) |
Value * | operator-> () const |
Value & | operator* () const |
Friends | |
struct | DenseMapInfo< AssertingVH< ValueTy > > |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::ValueHandleBase | |
static void | ValueIsDeleted (Value *V) |
static void | ValueIsRAUWd (Value *Old, Value *New) |
Protected Types inherited from llvm::ValueHandleBase | |
enum | HandleBaseKind { Assert, Callback, Weak, WeakTracking } |
This indicates what sub class the handle actually is. More... | |
Protected Member Functions inherited from llvm::ValueHandleBase | |
ValueHandleBase (const ValueHandleBase &RHS) | |
ValueHandleBase (HandleBaseKind Kind, const ValueHandleBase &RHS) | |
Value * | getValPtr () const |
void | RemoveFromUseList () |
Remove this ValueHandle from its current use list. More... | |
void | clearValPtr () |
Clear the underlying pointer without clearing the use list. More... | |
Static Protected Member Functions inherited from llvm::ValueHandleBase | |
static bool | isValid (Value *V) |
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 238 of file ValueHandle.h.
|
inline |
Definition at line 262 of file ValueHandle.h.
|
inline |
Definition at line 263 of file ValueHandle.h.
|
inline |
Definition at line 264 of file ValueHandle.h.
|
inline |
Definition at line 270 of file ValueHandle.h.
References llvm::ValueHandleBase::getValPtr().
|
inline |
Definition at line 284 of file ValueHandle.h.
|
inline |
Definition at line 283 of file ValueHandle.h.
|
inline |
Definition at line 274 of file ValueHandle.h.
|
inline |
Definition at line 278 of file ValueHandle.h.
|
friend |
Definition at line 243 of file ValueHandle.h.