12#ifndef FORTRAN_RUNTIME_POINTER_H_
13#define FORTRAN_RUNTIME_POINTER_H_
15#include "flang/Runtime/descriptor-consts.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);
64void RTDECL(PointerAssociateRemapping)(Descriptor &,
const Descriptor &target,
65 const Descriptor &bounds,
const char *sourceFile =
nullptr,
67void RTDECL(PointerAssociateRemappingMonomorphic)(Descriptor &,
68 const Descriptor &target,
const Descriptor &bounds,
69 const char *sourceFile =
nullptr,
int sourceLine = 0);
78int RTDECL(PointerCheckLengthParameter)(Descriptor &,
79 int which , SubscriptValue other,
80 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
81 const char *sourceFile =
nullptr,
int sourceLine = 0);
91int RTDECL(PointerAllocate)(Descriptor &,
bool hasStat =
false,
92 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
94int RTDECL(PointerAllocateSource)(Descriptor &,
const Descriptor &source,
95 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
96 const char *sourceFile =
nullptr,
int sourceLine = 0);
103int RTDECL(PointerDeallocate)(Descriptor &,
bool hasStat =
false,
104 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
109int RTDECL(PointerDeallocatePolymorphic)(Descriptor &,
110 const typeInfo::DerivedType *,
bool hasStat =
false,
111 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
117bool RTDECL(PointerIsAssociated)(
const Descriptor &);
120bool RTDECL(PointerIsAssociatedWith)(
121 const Descriptor &,
const Descriptor *target);
125RT_API_ATTRS
void *AllocateValidatedPointerPayload(
126 std::size_t,
int allocatorIdx = 0);
127RT_API_ATTRS
bool ValidatePointerPayload(
const ISO::CFI_cdesc_t &);