[flang] Support coarrays in name resolution
authorTim Keith <tkeith@nvidia.com>
Thu, 4 Apr 2019 21:46:40 +0000 (14:46 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 4 Apr 2019 21:47:59 +0000 (14:47 -0700)
commitb7efa8b77b11d99dce6afd98227e676594f4cd6e
treed50cfa6b942021374f4cbebc4a4cefa07af8c275
parent924c38356c2792f28ab332edbd0d30aeb0ccfd6a
[flang] Support coarrays in name resolution

A coarray is represented as a `Symbol` with `ObjectEntityDetails` that
has a non-empty coshape. The coshape is represented using the same type
(`ArrayShape`) as the shape is, so the fact that it is a coshape is
determined from context.

Move code for analyzing shapes to `resolve-names-utils.cc` and
generalize it for coshapes.

In `symbol.cc` add dumping of coshapes. Simplify some of the functions
by adding some `Dump*` functions to handle common cases.

In `mod-file.cc` generalize the code for writing shapes to also write
coshapes. Fix a bug in `PutShapeSpec()`.

Original-commit: flang-compiler/f18@9d2482c40c78cad55701a9cbc52a2294cae94d44
Reviewed-on: https://github.com/flang-compiler/f18/pull/384
Tree-same-pre-rewrite: false
flang/lib/semantics/mod-file.cc
flang/lib/semantics/resolve-names-utils.cc
flang/lib/semantics/resolve-names-utils.h
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/symbol.h
flang/test/semantics/CMakeLists.txt
flang/test/semantics/modfile24.f90 [new file with mode: 0644]
flang/test/semantics/resolve07.f90