[flang] These changes are for issue 458, to perform semantic checks on DO variable
authorPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 4 Jun 2019 22:14:34 +0000 (15:14 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 10 Jun 2019 20:31:31 +0000 (13:31 -0700)
commit93a59505a5d76a5b2c4b3ca56e4bf02175cfe6ec
tree58cbef63ed679760f9d2afd1b0a12c06829427e8
parentcd4491bb681fc279de883ab0071dbe2e14cab1e0
[flang] These changes are for issue 458, to perform semantic checks on DO variable
and initial, final, and step expressions.  As a new extension, we want to allow
REAL and DOUBLE PRECISION values for them by default.

Here's a summary of the changes:
 - There already existed infrastructure for semantic checking of DO loops that
   was partially specific to DO CONCURRENT loops.  Because I re-used some of
   this infrastructure, I renamed some files and classes from "concurrent" to
   "stmt".
 - I added some functions to distinguish among the different kinds of DO
   statements.
 - I added the functions to check-do-stmt.cc to produce the necessary warnins
   and errors.  Note that there are no tests for the warnings since the
   necessary testing infrastructure does not yet exist.
 - I changed test-errors.sh so that additional compilation options can be
   specified in the test source.
 - I added two new tests to test for the various kinds of values that can be
   used for the DO variables and control expressions.  The two tests are
   identical except for the use of different compilation options.
   dosemantics03.f90 specifies the options "-Mstandard -Werror" to produce
   error messages for the use of REAL and DOUBLE PRECISION DO variables and
   controls.  dosemantics04.f90 uses the default options and only produces
   error messages for contructs that are erroneous by default.

Original-commit: flang-compiler/f18@f484660c75941b5af93bd8bc7aabe73ab958769c
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
flang/documentation/Extensions.md
flang/lib/parser/parse-tree.cc
flang/lib/parser/parse-tree.h
flang/lib/semantics/CMakeLists.txt
flang/lib/semantics/check-do-stmt.cc [moved from flang/lib/semantics/check-do-concurrent.cc with 83% similarity]
flang/lib/semantics/check-do-stmt.h [moved from flang/lib/semantics/check-do-concurrent.h with 56% similarity]
flang/lib/semantics/semantics.cc
flang/test/semantics/CMakeLists.txt
flang/test/semantics/dosemantics03.f90 [new file with mode: 0644]
flang/test/semantics/dosemantics04.f90 [new file with mode: 0644]
flang/test/semantics/test_errors.sh