[flang] More coarray name resolution and semantic checks
authorTim Keith <tkeith@nvidia.com>
Mon, 15 Apr 2019 17:26:20 +0000 (10:26 -0700)
committerGitHub <noreply@github.com>
Mon, 15 Apr 2019 21:07:11 +0000 (14:07 -0700)
commitb2f84a5eda64f4d5185c14ed82851fadbc054e23
tree91df2690faf9c939b972631b3ba0be0a621f8dc2
parentecc38699642048ed64a4478a1abc22dfd4f0ded1
[flang] More coarray name resolution and semantic checks

Add CoarrayChecker to check for valid team-value in CHANGE TEAM,
SYNC TEAM, and image selector. Check that coarray names and selector
names are distinct in CHANGE TEAM.

Resolve the variable in a coarray-association.
Create a scope for the construct entities of a CHANGE TEAM construct.

Add ResolveSelector to resolve a parser::Selector into an Expr and
optional variable name (and a source location for messages). Make use of
ResolveSelector to handle coarray-association, as well as it's previous
use in associate-stmt.

Improve the check for C1157 in select-type-stmt and add a test.

Add a test for "Associate name must have a type".

Move ResolveName, ResolveDataRef, etc. from ResolveNamesVisitor
to DeclarationVisitor so that they are available in ConstructVisitor
as well. Add ResolveVariable and ResolveDesignator.

In the parse tree, change TeamValue from a type alias to a wrapper
class. We already had a wrapper class anyway, ImageSelectorSpec::Team,
so the new TeamValue can be used instead. This allows the member
of ImageSelectorSpec to be treated like other occurrences of TeamValue.

Original-commit: flang-compiler/f18@f856744b542a453dea1a9e01ad4e629bf072cff3
Reviewed-on: https://github.com/flang-compiler/f18/pull/414
Tree-same-pre-rewrite: false
16 files changed:
flang/lib/parser/dump-parse-tree.h
flang/lib/parser/grammar.h
flang/lib/parser/parse-tree.h
flang/lib/parser/unparse.cc
flang/lib/semantics/CMakeLists.txt
flang/lib/semantics/check-coarray.cc [new file with mode: 0644]
flang/lib/semantics/check-coarray.h [new file with mode: 0644]
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/semantics.cc
flang/test/semantics/CMakeLists.txt
flang/test/semantics/coarrays01.f90 [new file with mode: 0644]
flang/test/semantics/coarrays02.f90 [new file with mode: 0644]
flang/test/semantics/doconcurrent01.f90
flang/test/semantics/resolve39.f90
flang/test/semantics/resolve50.f90 [new file with mode: 0644]
flang/test/semantics/resolve51.f90 [new file with mode: 0644]