Like getObjectSize(), but only for base objects.
Declared in <llvm/Analysis/MemoryBuiltins.h>
std::optional<TypeSize>
getBaseObjectSize(
Value const* Ptr,
DataLayout const& DL,
TargetLibraryInfo const* TLI,
ObjectSizeOpts Opts = {});
Returns the size of base objects (like allocas, global variables and allocator calls) and std::nullopt otherwise. Requires ExactSizeFromOffset mode.
The base object size, or std::nullopt if Ptr is not a base object.
| Name | Description |
|---|---|
| Ptr | Pointer that may refer to a base object. |
| DL | Data layout used for type and pointer sizing. |
| TLI | Target library info used to identify allocation functions. |
| Opts | Options controlling how object size is evaluated. |