FLANG
fir::PendingAllocationInfo Struct Reference

#include <flang/Optimizer/Support/AllocationPolicy.h>

Inheritance diagram for fir::PendingAllocationInfo:
fir::AllocationInfo

Public Attributes

bool isTemporary = false
bool isDynamic = false
std::optional< std::int64_t > byteSize
 The constant size of the allocation in bytes, if it can be determined.

Detailed Description

Facts about an array allocation that are known before it is created. This is the input to shouldAllocateOnStack, which lets code that generates temporaries pick the right kind of allocation upfront instead of relying on the allocation-placement pass to fix it up afterwards. Deciding upfront is preferable when the generator also emits the deallocation, because the lifetime is then known by construction and does not have to be proven.

Member Data Documentation

◆ isDynamic

bool fir::PendingAllocationInfo::isDynamic = false

True if the allocation has a runtime-determined size. Note this is not the same as !byteSize: a constant-size array may have no computable byteSize (e.g. when no data layout is available), in which case it is not dynamic but its size is still unknown.

◆ isTemporary

bool fir::PendingAllocationInfo::isTemporary = false

True if the allocation is a compiler temporary (as opposed to a user variable).


The documentation for this struct was generated from the following file: