[all-commits] [llvm/llvm-project] d52a6e: [flang] Process subprogram BIND(C, NAME=...) locally

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue May 24 14:00:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d52a6e75b0c402c7f3b42a2b1b2873f151220947
      https://github.com/llvm/llvm-project/commit/d52a6e75b0c402c7f3b42a2b1b2873f151220947
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-05-24 (Tue, 24 May 2022)

  Changed paths:
    M flang/lib/Semantics/resolve-names.cpp
    M flang/test/Lower/program-units-fir-mangling.f90

  Log Message:
  -----------
  [flang] Process subprogram BIND(C,NAME=...) locally

The scalar-default-character-expression that defines the interoperable
name of a function or subroutine (or interface) must have its names
resolved within the context of the subprogram, despite its appearance
on a function-stmt or a subroutine-stmt.  Failure to do so can lead
to bogus errors or to incorrect results.

The solution is to defer name resolution for function-stmt suffixes
(but not entry-stmt suffixes) and for subroutine-stmt language binding
specifications to EndSubprogram().  (Their resolution only need to be
deferred to the end of the specification part, but it's cleanest to
deal with it in EndSubprogram().)

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




More information about the All-commits mailing list