11#ifndef FORTRAN_RUNTIME_ALLOCATABLE_H_
12#define FORTRAN_RUNTIME_ALLOCATABLE_H_
14#include "flang/Runtime/descriptor.h"
15#include "flang/Runtime/entry-names.h"
17namespace Fortran::runtime {
29void RTDECL(AllocatableInitIntrinsic)(
30 Descriptor &, TypeCategory,
int kind,
int rank = 0,
int corank = 0);
31void RTDECL(AllocatableInitCharacter)(Descriptor &, SubscriptValue length = 0,
32 int kind = 1,
int rank = 0,
int corank = 0);
33void RTDECL(AllocatableInitDerived)(
34 Descriptor &,
const typeInfo::DerivedType &,
int rank = 0,
int corank = 0);
40void RTDECL(AllocatableInitIntrinsicForAllocate)(
41 Descriptor &, TypeCategory,
int kind,
int rank = 0,
int corank = 0);
42void RTDECL(AllocatableInitCharacterForAllocate)(Descriptor &,
43 SubscriptValue length = 0,
int kind = 1,
int rank = 0,
int corank = 0);
44void RTDECL(AllocatableInitDerivedForAllocate)(
45 Descriptor &,
const typeInfo::DerivedType &,
int rank = 0,
int corank = 0);
53int RTDECL(AllocatableCheckAllocated)(Descriptor &,
54 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
60void RTDECL(AllocatableApplyMold)(
61 Descriptor &,
const Descriptor &mold,
int rank = 0);
65void RTDECL(AllocatableSetBounds)(
66 Descriptor &,
int zeroBasedDim, SubscriptValue lower, SubscriptValue upper);
69void RTDECL(AllocatableSetCoBounds)(Descriptor &,
int zeroBasedCoDim,
70 SubscriptValue lower, SubscriptValue upper = 0);
75void RTDECL(AllocatableSetDerivedLength)(
76 Descriptor &,
int which, SubscriptValue);
83int RTDECL(AllocatableCheckLengthParameter)(Descriptor &,
84 int which , SubscriptValue other,
85 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
86 const char *sourceFile =
nullptr,
int sourceLine = 0);
97int RTDECL(AllocatableAllocate)(Descriptor &,
bool hasStat =
false,
98 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
100int RTDECL(AllocatableAllocateSource)(Descriptor &,
const Descriptor &source,
101 bool hasStat =
false,
const Descriptor *errMsg =
nullptr,
102 const char *sourceFile =
nullptr,
int sourceLine = 0);
108std::int32_t RTDECL(MoveAlloc)(Descriptor &to, Descriptor &from,
109 const typeInfo::DerivedType *,
bool hasStat =
false,
110 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
116int RTDECL(AllocatableDeallocate)(Descriptor &,
bool hasStat =
false,
117 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
122int RTDECL(AllocatableDeallocatePolymorphic)(Descriptor &,
123 const typeInfo::DerivedType *,
bool hasStat =
false,
124 const Descriptor *errMsg =
nullptr,
const char *sourceFile =
nullptr,
128void RTDECL(AllocatableDeallocateNoFinal)(
129 Descriptor &,
const char *sourceFile =
nullptr,
int sourceLine = 0);