Compute the size of the object pointed by Ptr. Returns true and the object size in Size if successful, and false otherwise. In this context, by object we mean the region of memory starting at Ptr to the end of the underlying object pointed to by Ptr.

Synopsis

Declared in <llvm/Analysis/MemoryBuiltins.h>

bool
getObjectSize(
    Value const* Ptr,
    uint64_t& Size,
    DataLayout const& DL,
    TargetLibraryInfo const* TLI,
    ObjectSizeOpts Opts = {});

Description

WARNING: The object size returned is the allocation size. This does not imply dereferenceability at site of use since the object may be freeed in between.

Parameters

Name

Description

Ptr

LLVM Value Representation

DL

A parsed version of the target data layout string in and methods for querying it.

TLI

Provides information about what library functions are available for the current target.

Opts

Various options to control the behavior of getObjectSize.

Created with MrDocs