[all-commits] [llvm/llvm-project] 33c27f: [flang] Warn about undefined function results (#99...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Jul 30 09:42:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33c27f28d1cd05fd0a739498105927c1fba04666
      https://github.com/llvm/llvm-project/commit/33c27f28d1cd05fd0a739498105927c1fba04666
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-07-30 (Tue, 30 Jul 2024)

  Changed paths:
    M flang/include/flang/Common/Fortran-features.h
    M flang/include/flang/Semantics/semantics.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Semantics/check-allocate.cpp
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-purity.cpp
    M flang/lib/Semantics/definable.cpp
    M flang/lib/Semantics/definable.h
    M flang/lib/Semantics/pointer-assignment.cpp
    M flang/lib/Semantics/semantics.cpp
    M flang/lib/Semantics/tools.cpp
    M flang/test/Evaluate/folding08.f90
    M flang/test/Semantics/call02.f90
    M flang/test/Semantics/call05.f90
    M flang/test/Semantics/contiguous01.f90
    M flang/test/Semantics/resolve53.f90
    A flang/test/Semantics/undef-result01.f90

  Log Message:
  -----------
  [flang] Warn about undefined function results (#99533)

When the result of a function never appears in a variable definition
context, emit a warning.

If the function has multiple result variables due to alternate ENTRY
statements, any definition will suffice.

The implementation of this check is tied to the general variable
definability checking utility in semantics. Every variable definition
context uses it to ensure that no undefinable variable is being defined.
A set of defined variables is maintained in the SemanticsContext and,
when the warning is enabled and no fatal error has been reported, the
scope tree is traversed and all the function subprograms' results are
tested for membership in that set.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list