[flang] Lower polymorphic entities types in dummy argument and function result
authorValentin Clement <clementval@gmail.com>
Tue, 4 Oct 2022 07:42:39 +0000 (09:42 +0200)
committerValentin Clement <clementval@gmail.com>
Tue, 4 Oct 2022 07:43:59 +0000 (09:43 +0200)
commit9d99b482cdc288dabe5ec1924177238d438ef093
treedc45450749d4658fe4ea3bf1dc86541fe22c708a
parentdb720dc17ca435ffb9a0c6ba63ebb92e130b38e6
[flang] Lower polymorphic entities types in dummy argument and function result

This patch updates lowering to produce the correct fir.class types for
various polymorphic and unlimited polymoprhic entities cases. This is only the
lowering. Some TODOs have been added to the CodeGen part to avoid errors since
this part still need to be updated as well.
The fir.class<*> representation for unlimited polymorphic entities mentioned in
the document has been updated to fir.class<none> to avoid useless work in pretty
parse/printer.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Depends on D134957

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D134959
16 files changed:
flang/include/flang/Optimizer/Builder/BoxValue.h
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/include/flang/Optimizer/Dialect/FIRType.h
flang/include/flang/Optimizer/Dialect/FIRTypes.td
flang/include/flang/Semantics/tools.h
flang/lib/Lower/CallInterface.cpp
flang/lib/Lower/ConvertExpr.cpp
flang/lib/Lower/ConvertType.cpp
flang/lib/Lower/ConvertVariable.cpp
flang/lib/Lower/IntrinsicCall.cpp
flang/lib/Optimizer/Builder/BoxValue.cpp
flang/lib/Optimizer/Builder/MutableBox.cpp
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
flang/lib/Optimizer/CodeGen/TypeConverter.h
flang/lib/Optimizer/Dialect/FIRType.cpp
flang/test/Lower/polymorphic-types.f90 [new file with mode: 0644]