[flang-commits] [PATCH] D120804: [flang] Support PDT type descriptors in codegen
Jean Perier via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Mar 2 02:43:30 PST 2022
jeanPerier created this revision.
jeanPerier added reviewers: clementval, schweitz.
jeanPerier added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This change updates the mapping of derived types and type descriptor
object names to support kind parametrized derived types (PDT).
It moves the custom name mapping to the internal name utility.
To improve robustness and error reporting, type descriptors are also now
required to be generated in all compilation unit that manipulates
derived types. The previous codegen relied on the fact that descriptors
not defined in the current FIR module were available externally. Errors
with missing type descriptors were only caught at link time.
This patch makes derived type definition mandatory, except if the
derived types are expected to not have derived type descriptors (builtin
types), or if the newly added debug switch `--ignore-missing-type-desc`
is set. In those cases, a null pointer is used as type descriptor
pointer. The debug switch intends to help testing FIR to LLVM passes
without having to bother providing type descriptor data structures that
are normally built by the front-end.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120804
Files:
flang/include/flang/Optimizer/CodeGen/CodeGen.h
flang/include/flang/Optimizer/Dialect/FIRTypes.td
flang/include/flang/Optimizer/Support/InternalNames.h
flang/include/flang/Tools/CLOptions.inc
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/Dialect/FIRType.cpp
flang/lib/Optimizer/Support/InternalNames.cpp
flang/test/Fir/convert-to-llvm.fir
flang/test/Fir/ignore-missing-type-descriptor.fir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120804.412363.patch
Type: text/x-patch
Size: 14003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220302/e30618ef/attachment.bin>
More information about the flang-commits
mailing list