[flang-commits] [PATCH] D148257: [flang] Rework handling of non-type-bound user-defined I/O

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Apr 13 10:53:03 PDT 2023


klausler created this revision.
klausler added a reviewer: vdonaldson.
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.

A fairly recent introduction of runtime I/O APIs called OutputDerivedType()                                                                                                                                                                                                                                                                     
and InputDerivedType() didn't cover NAMELIST I/O's need to access                                                                                                                                                                                                                                                                               
non-type-bound generic interfaces for user-defined derived type I/O                                                                                                                                                                                                                                                                             
when those generic interfaces are defined in some scope other than the                                                                                                                                                                                                                                                                          
one that defines the derived type.

The patch adds a new data structure shared between lowering                                                                                                                                                                                                                                                                                     
and the runtime that can represent all of the cases that can                                                                                                                                                                                                                                                                                    
arise with non-type-bound defined I/O.  It can represent                                                                                                                                                                                                                                                                                        
scopes in which non-type-bound defined I/O generic interfaces                                                                                                                                                                                                                                                                                   
are inaccessible, too, due to IMPORT statements.

The data structure is now an operand to OutputDerivedType() and                                                                                                                                                                                                                                                                                 
InputDerivedType() as well as a data member in the NamelistGroup                                                                                                                                                                                                                                                                                
structure.


https://reviews.llvm.org/D148257

Files:
  flang/include/flang/Common/Fortran.h
  flang/include/flang/Runtime/io-api.h
  flang/include/flang/Semantics/runtime-type-info.h
  flang/include/flang/Semantics/symbol.h
  flang/include/flang/Semantics/tools.h
  flang/lib/Common/Fortran.cpp
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/check-io.cpp
  flang/lib/Semantics/check-io.h
  flang/lib/Semantics/resolve-names-utils.cpp
  flang/lib/Semantics/runtime-type-info.cpp
  flang/lib/Semantics/symbol.cpp
  flang/lib/Semantics/tools.cpp
  flang/module/__fortran_type_info.f90
  flang/runtime/CMakeLists.txt
  flang/runtime/descriptor-io.cpp
  flang/runtime/descriptor-io.h
  flang/runtime/format-implementation.h
  flang/runtime/format.h
  flang/runtime/io-api.cpp
  flang/runtime/namelist.cpp
  flang/runtime/namelist.h
  flang/runtime/non-tbp-dio.cpp
  flang/runtime/non-tbp-dio.h
  flang/runtime/type-info.h
  flang/runtime/unit.h
  flang/test/Semantics/typeinfo01.f90
  flang/test/Semantics/typeinfo02.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148257.513305.patch
Type: text/x-patch
Size: 76827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230413/5905fdd6/attachment-0001.bin>


More information about the flang-commits mailing list