Return true if this pointer may be captured by the enclosing function.

Synopsis

Declared in <llvm/Analysis/CaptureTracking.h>

bool
PointerMayBeCaptured(
    Value const* V,
    bool ReturnCaptures,
    unsigned int MaxUsesToExplore = 0);

Description

The enclosing function is required to exist. This routine can be expensive, so consider caching the results.

This function only considers captures of the passed value via its def‐use chain, without considering captures of values it may be based on, or implicit captures such as for external globals.

Return Value

True if the pointer may be captured by the enclosing function.

Parameters

Name

Description

V

Pointer value whose captures are queried.

ReturnCaptures

Whether returning the value (or part of it) counts as capturing it.

MaxUsesToExplore

How many uses to explore before giving up; zero means use the default.

Created with MrDocs