[all-commits] [llvm/llvm-project] 710503: [flang] Finalize polymorphic alloctable component ...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Sep 25 09:53:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 710503fc1b9ace4b88cc132b4306346d508cef7f
      https://github.com/llvm/llvm-project/commit/710503fc1b9ace4b88cc132b4306346d508cef7f
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Semantics/runtime-type-info.cpp
    M flang/lib/Semantics/tools.cpp
    A flang/test/Semantics/typeinfo07.f90

  Log Message:
  -----------
  [flang] Finalize polymorphic alloctable component if needed (#67326)

The runtime skips finalization if the runtime type info
"nofinalizationneeded" is set, so it should not be set if the derived
type has polymorphic allocatable components since they may be allocated
to some type extension with a final methods.
IsFinalizable cannot be updated since polymorphic allocatable components
do not imply a final routine will actually be called (it depends of the
dynamic type, which semantics cannot know about), and this would not
match the "Finalizable" definition of the standard in 7.5.6.1. Hence,
this patch adds a MayRequireFinalization helper.

The component visitor change is to avoid crashing in
FindPolymorphicAllocatableUltimateComponent in the test
test/Driver/dump-all-bad.f90 that tries generating runtime type info
even after some semantic error is raised under debug-dump options.




More information about the All-commits mailing list