[flang-commits] [flang] [flang][lowering] Move PDT TODO before length param type lowering (PR #67650)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 28 02:31:18 PDT 2023
https://github.com/jeanPerier created https://github.com/llvm/llvm-project/pull/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.
>From 0680d33bbd67c2e5d92cdf6005749e7f65e0d010 Mon Sep 17 00:00:00 2001
From: Jean Perier <jperier at nvidia.com>
Date: Thu, 28 Sep 2023 02:14:05 -0700
Subject: [PATCH] [flang][lowering] Move PDT TODO before length param type
lowering
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.
---
flang/lib/Lower/ConvertType.cpp | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index bfddf9a15084c85..efaeba29b762ad4 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 ¶m :
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');
More information about the flang-commits
mailing list