Skip to content

[flang][lowering] Move PDT TODO before length param type lowering #67650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions flang/lib/Lower/ConvertType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,21 +403,26 @@ struct TypeBuilderImpl {
cs.emplace_back(converter.getRecordTypeFieldName(component), ty);
}

mlir::Location loc = converter.genLocation(typeSymbol.name());
// (2) The LEN type parameters.
for (const auto &param :
Fortran::semantics::OrderParameterDeclarations(typeSymbol))
if (param->get<Fortran::semantics::TypeParamDetails>().attr() ==
Fortran::common::TypeParamAttr::Len)
Fortran::common::TypeParamAttr::Len) {
TODO(loc, "parameterized derived types");
// TODO: emplace in ps. Beware that param is the symbol in the type
// declaration, not instantiation: its kind may not be a constant.
// The instantiated symbol in tySpec.scope should be used instead.
ps.emplace_back(param->name().ToString(), genSymbolType(*param));
}

rec.finalize(ps, cs);
popDerivedTypeInConstruction();

mlir::Location loc = converter.genLocation(typeSymbol.name());
if (!ps.empty()) {
// This type is a PDT (parametric derived type). Create the functions to
// use for allocation, dereferencing, and address arithmetic here.
TODO(loc, "parameterized derived types");
// TODO: this type is a PDT (parametric derived type) with length
// parameter. Create the functions to use for allocation, dereferencing,
// and address arithmetic here.
}
LLVM_DEBUG(llvm::dbgs() << "derived type: " << rec << '\n');

Expand Down