Skip to content

Commit 38b54c7

Browse files
committed
[flang] fix shared library builds after #81166
Fix https://lab.llvm.org/buildbot/#/builders/268/builds/7826 IsDerivedTypeWithLengthParameter cannot be used here, it would make libFortranEvaluate dependent on linFortranSemantics. Replace by loop through parameter values.
1 parent 2f8e37d commit 38b54c7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

flang/lib/Evaluate/characteristics.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,13 @@ bool DummyDataObject::IsPassedByDescriptor(bool isBindC) const {
474474
// Need to pass dynamic type info in a descriptor.
475475
return true;
476476
} else if (const auto *derived{GetDerivedTypeSpec(type.type())}) {
477-
if (const semantics::Scope *scope = derived->scope()) {
478-
// Need to pass length type parameters in a descriptor if any.
479-
return scope->IsDerivedTypeWithLengthParameter();
477+
if (!derived->parameters().empty()) {
478+
for (const auto &param : derived->parameters()) {
479+
if (param.second.isLen()) {
480+
// Need to pass length type parameters in a descriptor.
481+
return true;
482+
}
483+
}
480484
}
481485
} else if (isBindC && type.type().IsAssumedLengthCharacter()) {
482486
// Fortran 2018 18.3.6 point 2 (5)

0 commit comments

Comments
 (0)