12#ifndef FORTRAN_RUNTIME_POINTER_H_
13#define FORTRAN_RUNTIME_POINTER_H_
15#include "flang/Runtime/descriptor.h"
16#include "flang/Runtime/entry-names.h"
18namespace Fortran::runtime {
24void RTDECL(PointerNullifyIntrinsic)(
25 Descriptor &, TypeCategory,
int kind,
int rank = 0,
int corank = 0);
26void RTDECL(PointerNullifyCharacter)(Descriptor &, SubscriptValue length = 0,
27 int kind = 1,
int rank = 0,
int corank = 0);
28void RTDECL(PointerNullifyDerived)(
29 Descriptor &,
const typeInfo::DerivedType &,
int rank = 0,
int corank = 0);
33void RTDECL(PointerSetBounds)(
34 Descriptor &,
int zeroBasedDim, SubscriptValue lower, SubscriptValue upper);
35void RTDECL(PointerSetCoBounds)(Descriptor &,
int zeroBasedCoDim,
36 SubscriptValue lower, SubscriptValue upper = 0);
41void RTDECL(PointerSetDerivedLength)(Descriptor &,
int which, SubscriptValue);
45void RTDECL(PointerApplyMold)(
46 Descriptor &,
const Descriptor &mold,
int rank = 0);
51void RTDECL(PointerAssociateScalar)(Descriptor &,
void *);
55void RTDECL(PointerAssociate)(Descriptor &,
const Descriptor &target);
56void RTDECL(PointerAssociateLowerBounds)(
57 Descriptor &,
const Descriptor &target,
const Descriptor &lowerBounds);
62void RTDECL(PointerAssociateRemapping)(Descriptor &,
const Descriptor &target,
63 const Descriptor &bounds,
const char *sourceFile =
nullptr,
73int RTDECL(PointerCheckLengthParameter)(Descriptor &,
74 int which , SubscriptValue other,
75 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
76 const char *sourceFile =
nullptr,
int sourceLine = 0);
86int RTDECL(PointerAllocate)(Descriptor &,
bool hasStat =
false,
87 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
89int RTDECL(PointerAllocateSource)(Descriptor &,
const Descriptor &source,
90 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
91 const char *sourceFile =
nullptr,
int sourceLine = 0);
98int RTDECL(PointerDeallocate)(Descriptor &,
bool hasStat =
false,
99 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
104int RTDECL(PointerDeallocatePolymorphic)(Descriptor &,
105 const typeInfo::DerivedType *,
bool hasStat =
false,
106 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
112bool RTDECL(PointerIsAssociated)(
const Descriptor &);
115bool RTDECL(PointerIsAssociatedWith)(
116 const Descriptor &,
const Descriptor *target);
120RT_API_ATTRS
void *AllocateValidatedPointerPayload(std::size_t);
121RT_API_ATTRS
bool ValidatePointerPayload(
const ISO::CFI_cdesc_t &);