[all-commits] [llvm/llvm-project] 573fc6: [flang] Fix pointer definition semantic checking v...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Oct 31 12:02:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 573fc6187b82290665ed7d94aa50641d06260a9e
      https://github.com/llvm/llvm-project/commit/573fc6187b82290665ed7d94aa50641d06260a9e
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M flang/docs/Parsing.md
    M flang/include/flang/Parser/message.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Semantics/CMakeLists.txt
    M flang/lib/Semantics/assignment.cpp
    M flang/lib/Semantics/assignment.h
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/check-io.cpp
    M flang/lib/Semantics/check-nullify.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/data-to-inits.cpp
    A flang/lib/Semantics/definable.cpp
    A flang/lib/Semantics/definable.h
    M flang/lib/Semantics/expression.cpp
    M flang/lib/Semantics/pointer-assignment.cpp
    M flang/lib/Semantics/pointer-assignment.h
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/tools.cpp
    M flang/test/Semantics/OpenMP/omp-lastprivate01.f90
    M flang/test/Semantics/OpenMP/omp-reduction04.f90
    M flang/test/Semantics/assign02.f90
    M flang/test/Semantics/assign03.f90
    M flang/test/Semantics/assign04.f90
    M flang/test/Semantics/atomic02.f90
    M flang/test/Semantics/atomic03.f90
    M flang/test/Semantics/atomic04.f90
    M flang/test/Semantics/atomic05.f90
    M flang/test/Semantics/atomic06.f90
    M flang/test/Semantics/atomic07.f90
    M flang/test/Semantics/atomic08.f90
    M flang/test/Semantics/atomic10.f90
    M flang/test/Semantics/call03.f90
    M flang/test/Semantics/call06.f90
    M flang/test/Semantics/call10.f90
    M flang/test/Semantics/call12.f90
    M flang/test/Semantics/collectives01.f90
    M flang/test/Semantics/collectives02.f90
    M flang/test/Semantics/collectives03.f90
    M flang/test/Semantics/collectives04.f90
    M flang/test/Semantics/deallocate05.f90
    M flang/test/Semantics/io01.f90
    M flang/test/Semantics/io02.f90
    M flang/test/Semantics/io03.f90
    M flang/test/Semantics/io04.f90
    M flang/test/Semantics/io05.f90
    M flang/test/Semantics/io06.f90
    M flang/test/Semantics/modifiable01.f90
    M flang/test/Semantics/nullify02.f90
    M flang/test/Semantics/random-seed.f90
    M flang/test/Semantics/resolve35.f90
    M flang/test/Semantics/resolve57.f90
    M flang/test/Semantics/resolve62.f90
    M flang/test/Semantics/resolve76.f90
    M flang/test/Semantics/selecttype03.f90

  Log Message:
  -----------
  [flang] Fix pointer definition semantic checking via refactoring

The infrastructure in semantics that is used to check that the
left-hand sides of normal assignment statements are really definable
variables was not being used to check whether the LHSs of pointer assignments
are modifiable, and so most cases of unmodifiable pointers are left
undiagnosed.  Rework the semantics checking for pointer assignments,
NULLIFY statements, pointer dummy arguments, &c. so that cases of
unmodifiable pointers are properly caught.  This has been done
by extracting all the various definability checking code that has
been implemented for different contexts in Fortran into one new
facility.

The new consolidated definability checking code returns messages
meant to be attached as "because: " explanations to context-dependent
errors like "left-hand side of assignment is not definable".
These new error message texts and their attached explanations
affect many existing tests, which have been updated.  The testing
infrastructure was extended by another patch to properly compare
warnings and explanatory messages, which had been ignored until
recently.

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




More information about the All-commits mailing list