aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Lower/ConvertType.cpp
diff options
context:
space:
mode:
authorjeanPerier <jperier@nvidia.com>2023-09-28 17:09:23 +0200
committerGitHub <noreply@github.com>2023-09-28 17:09:23 +0200
commitbe30cd62a94ebd941b787f101363a584f220b2d3 (patch)
treed6dbf16a26a68f5c05724b504bd8c2fee978d34e /flang/lib/Lower/ConvertType.cpp
parent6cd5eb1f5469e3148c7504e0183b1b84227b495e (diff)
downloadllvm-be30cd62a94ebd941b787f101363a584f220b2d3.zip
llvm-be30cd62a94ebd941b787f101363a584f220b2d3.tar.gz
llvm-be30cd62a94ebd941b787f101363a584f220b2d3.tar.bz2
[flang][lowering] Move PDT TODO before length param type lowering (#67650)
There is a crash before hitting the TODO when the length parameter kind depends on a KIND parameter. I do not want to fix it since I cannot test it because of the TODO, so I just moved to TODO up and added a comment.
Diffstat (limited to 'flang/lib/Lower/ConvertType.cpp')
-rw-r--r--flang/lib/Lower/ConvertType.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index bfddf9a..efaeba2 100644
--- a/flang/lib/Lower/ConvertType.cpp
+++ b/flang/lib/Lower/ConvertType.cpp
@@ -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');