[all-commits] [llvm/llvm-project] 6111dd: [flang] Defer all function result type processing

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Apr 14 10:26:12 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6111ddedc8910d2b55dba4036c5489873791ceb3
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Semantics/resolve108.f90

  Log Message:
  [flang] Defer all function result type processing

When a type specification appears in the prefix of a FUNCTION statement,
defer its processing as late as possible so that any symbols in the
tpe specification can be resolved in the function's scope to local
declarations, including use-associated symbols.  f18 was already doing
this deferral in a limited form for derived types, and this patch
makes it work for intrinsic type parameter values as well.

In short, "real(kind(x)) function foo(x)" now works as it should.

"As late as possible" means the end of the specification part, or
the first appearance of the function result name in the specification

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

More information about the All-commits mailing list