[flang-commits] [PATCH] D144148: [flang] Always incorporate parent types' special generic bindings

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Feb 15 17:01:58 PST 2023


klausler created this revision.
klausler added a reviewer: clementval.
klausler added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
klausler requested review of this revision.

The runtime type information table generator was broken when dealing
with an extension derived type that didn't include a special generic
procedure binding for ASSIGNMENT(=) or user-defined I/O, but one of 
whose ancestor types did.  Ensure that the runtime derived type info
tables have complete subtables for all of these special bindings,
and respect any overrides that may have been defined.

Motivating example:

  type parent
   contains
    procedure :: dtWrite => dtWrite1
    generic :: write(formatted) => dtWrite
  end type
  type, extends(parent) :: extended
   contains
    procedure :: dtWrite => dtWrite2
  end type

The runtime derived type information table for "extended" must include
a special generic procedure entry for "write(formatted)" that points
to "dtWrite2" even though "extend" has no generic procedure for
"write(formatted)".


https://reviews.llvm.org/D144148

Files:
  flang/lib/Semantics/runtime-type-info.cpp
  flang/module/__fortran_type_info.f90
  flang/runtime/type-info.h
  flang/test/Semantics/typeinfo02.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144148.497846.patch
Type: text/x-patch
Size: 9725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230216/15b76129/attachment-0001.bin>


More information about the flang-commits mailing list