[flang-commits] [PATCH] D120839: [flang] Accommodate module subprograms defined in the same module

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Mar 2 11:22:02 PST 2022


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
klausler requested review of this revision.

The symbol table, name resolution, and semantic checks for module
subprograms -- esp. for MODULE FUNCTION and MODULE SUBROUTINE, but
also MODULE PROCEDURE -- essentially assumed that the subprogram
would be defined in a submodule of the (sub)module containing its
interface.  However, it is conforming to instead declare a module
subprogram in the *same* (sub)module as its interface, and we need
to handle that case.

Since this case involves two symbols in the same scope with the same
name, the symbol table details for subprograms have been extended
with a pointer to the original module interface, rather than relying
on searching in scopes.


https://reviews.llvm.org/D120839

Files:
  flang/include/flang/Semantics/symbol.h
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/symbol.cpp
  flang/lib/Semantics/tools.cpp
  flang/test/Semantics/nullify02.f90
  flang/test/Semantics/separate-mp02.f90
  flang/test/Semantics/separate-mp03.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120839.412497.patch
Type: text/x-patch
Size: 11443 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220302/f0a76c84/attachment-0001.bin>


More information about the flang-commits mailing list