[flang] Resolve array specifications of entities.
authorTim Keith <tkeith@nvidia.com>
Thu, 12 Apr 2018 19:59:42 +0000 (12:59 -0700)
committerpeter klausler <pklausler@nvidia.com>
Mon, 16 Apr 2018 20:37:59 +0000 (13:37 -0700)
commitafe25498e3dcd6c6489396be5a06f6a4eb206223
treedc8159373684b6d37adf7728f743835c12d850fa
parentf45a354519745f4de9918e4d15113e699f848d7d
[flang] Resolve array specifications of entities.

Add ArraySpecVisitor to recognize the various forms of array specifications.
They are tracked in arraySpec_ and attrArraySpec_. Both are needed because
a declaration like `integer, dimension(4) :: x(2,2), y` has two different
array-specs.

The method DeclareEntity was extracted out to handle the common part for
EntityDecl, ObjectDecl, and DimensionStmt. AllocatableStmt and TargetStmt
are now handled through their contained ObjectDecl.

The test resolve07 checks the interactions between these kinds of declarations.

Rename ComponentArraySpec to ArraySpec as it doesn't just occur in components.

Fix some 'begin' and 'end' methods to start with upper-case letters.

Original-commit: flang-compiler/f18@113bfc4fe7781b11c3d3399254a6fcea1afeedd5
Reviewed-on: https://github.com/flang-compiler/f18/pull/56
flang/lib/semantics/type.h