[flang] Refine WhyNotModifiable()
authorpeter klausler <pklausler@nvidia.com>
Sat, 16 Jan 2021 00:59:52 +0000 (16:59 -0800)
committerpeter klausler <pklausler@nvidia.com>
Tue, 19 Jan 2021 19:44:51 +0000 (11:44 -0800)
commit24e8e21f19f4380e8410a12f9135bfef3c046142
tree4865f4301ed3dc8fd6a8f96063bae6bf57445d2e
parent5fcb412ed0831ad763810f9b424149b3b353451a
[flang] Refine WhyNotModifiable()

The utility routine WhyNotModifiable() needed to become more
aware of the use of pointers in data-refs; the targets of
pointer components are sometimes modifiable even when the
leftmost ("base") symbol of a data-ref is not.

Added a new unit test for WhyNotModifiable() that uses internal
READ statements (mostly), since I/O semantic checking uses
WhyNotModifiable() for all its definability checking.

Differential Revision: https://reviews.llvm.org/D94849
flang/include/flang/Evaluate/tools.h
flang/lib/Evaluate/tools.cpp
flang/lib/Semantics/check-io.cpp
flang/lib/Semantics/tools.cpp
flang/test/Semantics/modifiable01.f90 [new file with mode: 0644]