[all-commits] [llvm/llvm-project] 868187: [flang] Handle type-bound procedures with alternat...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Thu Mar 11 10:21:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 868187df2132d54f7c282b7ca2ead4682631bf2a
      https://github.com/llvm/llvm-project/commit/868187df2132d54f7c282b7ca2ead4682631bf2a
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2021-03-11 (Thu, 11 Mar 2021)

  Changed paths:
    M flang/lib/Semantics/check-declarations.cpp
    M flang/test/Semantics/bindings01.f90

  Log Message:
  -----------
  [flang] Handle type-bound procedures with alternate returns

If you specify a type-bound procedure with an alternate return, there
will be no symbol associated with that dummy argument.  In such cases,
the compiler's list of dummy arguments will contain a nullptr.  In our
analysis of the PASS arguments of type-bound procedures, we were
assuming that all dummy arguments had non-null symbols associated with
them and were using that assumption to get the name of the dummy
argument.  This caused the compiler to try to dereference a nullptr.

I fixed this by explicitly checking for a nullptr and, in such cases, emitting
an error message.  I also added tests that contain type-bound procedures with
alternate returns in both legal and illegal constructs to ensure that semantic
analysis is working for them.

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




More information about the All-commits mailing list