[all-commits] [llvm/llvm-project] 013160: [flang] Support PDT type descriptors in codegen

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Mar 3 01:09:14 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 013160f6e26c840140cfcf0b1e8735a2d04e379e
      https://github.com/llvm/llvm-project/commit/013160f6e26c840140cfcf0b1e8735a2d04e379e
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-03-03 (Thu, 03 Mar 2022)

  Changed paths:
    M flang/include/flang/Optimizer/CodeGen/CodeGen.h
    M flang/include/flang/Optimizer/Dialect/FIRTypes.td
    M flang/include/flang/Optimizer/Support/InternalNames.h
    M flang/include/flang/Tools/CLOptions.inc
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/Dialect/FIRType.cpp
    M flang/lib/Optimizer/Support/InternalNames.cpp
    M flang/test/Fir/convert-to-llvm.fir
    A flang/test/Fir/ignore-missing-type-descriptor.fir

  Log Message:
  -----------
  [flang] Support PDT type descriptors in codegen

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.

Differential Revision: https://reviews.llvm.org/D120804




More information about the All-commits mailing list