@@ -163,14 +163,14 @@ class RuntimeTableBuilder {
163
163
RuntimeTableBuilder::RuntimeTableBuilder (
164
164
SemanticsContext &c, RuntimeDerivedTypeTables &t)
165
165
: context_{c}, tables_{t}, derivedTypeSchema_{GetSchema (" derivedtype" )},
166
- componentSchema_{GetSchema (" component" )}, procPtrSchema_{ GetSchema (
167
- " procptrcomponent" )},
168
- valueSchema_{GetSchema (" value" )}, bindingSchema_{ GetSchema (
169
- bindingDescCompName)},
170
- specialSchema_{GetSchema (" specialbinding" )}, deferredEnum_{ GetEnumValue (
171
- " deferred" )},
172
- explicitEnum_{GetEnumValue (" explicit" )}, lenParameterEnum_{ GetEnumValue (
173
- " lenparameter" )},
166
+ componentSchema_{GetSchema (" component" )},
167
+ procPtrSchema_{ GetSchema ( " procptrcomponent" )},
168
+ valueSchema_{GetSchema (" value" )},
169
+ bindingSchema_{ GetSchema ( bindingDescCompName)},
170
+ specialSchema_{GetSchema (" specialbinding" )},
171
+ deferredEnum_{ GetEnumValue ( " deferred" )},
172
+ explicitEnum_{GetEnumValue (" explicit" )},
173
+ lenParameterEnum_{ GetEnumValue ( " lenparameter" )},
174
174
scalarAssignmentEnum_{GetEnumValue (" scalarassignment" )},
175
175
elementalAssignmentEnum_{GetEnumValue (" elementalassignment" )},
176
176
readFormattedEnum_{GetEnumValue (" readformatted" )},
@@ -588,8 +588,9 @@ const Symbol *RuntimeTableBuilder::DescribeType(Scope &dtScope) {
588
588
DescribeSpecialGenerics (dtScope, dtScope, derivedTypeSpec)};
589
589
if (derivedTypeSpec) {
590
590
for (auto &ref : FinalsForDerivedTypeInstantiation (*derivedTypeSpec)) {
591
- DescribeSpecialProc (specials, *ref, false /* !isAssignment*/ , true ,
592
- std::nullopt, nullptr , derivedTypeSpec, true );
591
+ DescribeSpecialProc (specials, *ref, /* isAssignment-*/ false ,
592
+ /* isFinal=*/ true , std::nullopt, nullptr , derivedTypeSpec,
593
+ /* isTypeBound=*/ true );
593
594
}
594
595
IncorporateDefinedIoGenericInterfaces (specials,
595
596
common::DefinedIo::ReadFormatted, &scope, derivedTypeSpec);
@@ -1039,8 +1040,9 @@ void RuntimeTableBuilder::DescribeSpecialGeneric(const GenericDetails &generic,
1039
1040
[&](const GenericKind::OtherKind &k) {
1040
1041
if (k == GenericKind::OtherKind::Assignment) {
1041
1042
for (auto ref : generic.specificProcs ()) {
1042
- DescribeSpecialProc (specials, *ref, true , false /* !final*/ ,
1043
- std::nullopt, &dtScope, derivedTypeSpec, true );
1043
+ DescribeSpecialProc (specials, *ref, /* isAssignment=*/ true ,
1044
+ /* isFinal=*/ false , std::nullopt, &dtScope, derivedTypeSpec,
1045
+ /* isTypeBound=*/ true );
1044
1046
}
1045
1047
}
1046
1048
},
@@ -1051,8 +1053,9 @@ void RuntimeTableBuilder::DescribeSpecialGeneric(const GenericDetails &generic,
1051
1053
case common::DefinedIo::WriteFormatted:
1052
1054
case common::DefinedIo::WriteUnformatted:
1053
1055
for (auto ref : generic.specificProcs ()) {
1054
- DescribeSpecialProc (specials, *ref, false , false /* !final*/ , io,
1055
- &dtScope, derivedTypeSpec, true );
1056
+ DescribeSpecialProc (specials, *ref, /* isAssignment=*/ false ,
1057
+ /* isFinal=*/ false , io, &dtScope, derivedTypeSpec,
1058
+ /* isTypeBound=*/ true );
1056
1059
}
1057
1060
break ;
1058
1061
}
@@ -1076,6 +1079,7 @@ void RuntimeTableBuilder::DescribeSpecialProc(
1076
1079
if (auto proc{evaluate::characteristics::Procedure::Characterize (
1077
1080
specific, context_.foldingContext ())}) {
1078
1081
std::uint8_t isArgDescriptorSet{0 };
1082
+ std::uint8_t isArgContiguousSet{0 };
1079
1083
int argThatMightBeDescriptor{0 };
1080
1084
MaybeExpr which;
1081
1085
if (isAssignment) {
@@ -1115,19 +1119,27 @@ void RuntimeTableBuilder::DescribeSpecialProc(
1115
1119
if (proc->IsElemental ()) {
1116
1120
which = elementalFinalEnum_;
1117
1121
} else {
1118
- const auto &typeAndShape {
1122
+ const auto &dummyData {
1119
1123
std::get<evaluate::characteristics::DummyDataObject>(
1120
- proc->dummyArguments .at (0 ).u )
1121
- .type };
1124
+ proc->dummyArguments .at (0 ).u )};
1125
+ const auto &typeAndShape{dummyData .type };
1122
1126
if (typeAndShape.attrs ().test (
1123
1127
evaluate::characteristics::TypeAndShape::Attr::AssumedRank)) {
1124
1128
which = assumedRankFinalEnum_;
1125
1129
isArgDescriptorSet |= 1 ;
1126
1130
} else {
1127
1131
which = scalarFinalEnum_;
1128
1132
if (int rank{evaluate::GetRank (typeAndShape.shape ())}; rank > 0 ) {
1129
- argThatMightBeDescriptor = 1 ;
1130
1133
which = IntExpr<1 >(ToInt64 (which).value () + rank);
1134
+ if (!proc->dummyArguments [0 ].CanBePassedViaImplicitInterface ()) {
1135
+ argThatMightBeDescriptor = 1 ;
1136
+ }
1137
+ if (!typeAndShape.attrs ().test (evaluate::characteristics::
1138
+ TypeAndShape::Attr::AssumedShape) ||
1139
+ dummyData.attrs .test (evaluate::characteristics::
1140
+ DummyDataObject::Attr::Contiguous)) {
1141
+ isArgContiguousSet |= 1 ;
1142
+ }
1131
1143
}
1132
1144
}
1133
1145
}
@@ -1176,6 +1188,8 @@ void RuntimeTableBuilder::DescribeSpecialProc(
1176
1188
IntExpr<1 >(isArgDescriptorSet));
1177
1189
AddValue (values, specialSchema_, " istypebound" s,
1178
1190
IntExpr<1 >(isTypeBound ? 1 : 0 ));
1191
+ AddValue (values, specialSchema_, " isargcontiguousset" s,
1192
+ IntExpr<1 >(isArgContiguousSet));
1179
1193
AddValue (values, specialSchema_, procCompName,
1180
1194
SomeExpr{evaluate::ProcedureDesignator{specific}});
1181
1195
// index might already be present in the case of an override
@@ -1219,9 +1233,7 @@ RuntimeDerivedTypeTables BuildRuntimeDerivedTypeTables(
1219
1233
// dummy argument. Returns a non-null DeclTypeSpec pointer only if that
1220
1234
// dtv argument exists and is a derived type.
1221
1235
static const DeclTypeSpec *GetDefinedIoSpecificArgType (const Symbol &specific) {
1222
- const Symbol *interface {
1223
- &specific.GetUltimate ()
1224
- };
1236
+ const Symbol *interface{&specific.GetUltimate ()};
1225
1237
if (const auto *procEntity{specific.detailsIf <ProcEntityDetails>()}) {
1226
1238
interface = procEntity->procInterface ();
1227
1239
}
0 commit comments